Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion SnakeGamr/SnakeGamr/GameScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ class GameScene: SKScene {
}
}

func colorChange() -> SKColor {
let greenValue = SKColor.green
let blueValue = SKColor.blue
let redValue = SKColor.red

let newColor = CGFloat(red: redValue, green: greenValue, blue: blueValue, alpha: 1.0)
return newColor

//I can't get the code to work here it keeps swithcing the error message no matter what I do.

}

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
Expand All @@ -129,7 +140,6 @@ class GameScene: SKScene {
self.playButton.isHidden = true
}
let bottomCorner = CGPoint(x: 0, y: (frame.size.height / -2) + 20)
//bestScore.run(SKAction.move(to: bottomCorner, duration: 0.4))

bestScore.run(SKAction.move(to: bottomCorner, duration: 0.4)) {
self.gameBG.setScale(0)
Expand All @@ -143,6 +153,8 @@ class GameScene: SKScene {

}



private func initializeMenu(){
gameLogo = SKLabelNode(fontNamed: "ArialRoundedMTBold")
gameLogo.zPosition = 1
Expand Down
4 changes: 0 additions & 4 deletions SnakeGamr/SnakeGamr/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ class GameViewController: UIViewController {
super.viewDidLoad()

if let view = self.view as! SKView? {
// Load the SKScene from 'GameScene.sks'
if let scene = SKScene(fileNamed: "GameScene") {
// Set the scale mode to scale to fit the window
scene.scaleMode = .aspectFill

// Present the scene
view.presentScene(scene)
}

Expand Down