When you open the game, you click "Go" in the tutorial, then an image appears. When one swipes this image, if it does not go to the game over screen, the image should fly off the screen. This action can be found on line 365 and line 446.
var swipeTrueCurrentScreen = SKAction.moveToX(self.frame.size.width * 2, duration: 0.5)
currentImage.runAction(swipeTrueCurrentScreen)
A new image should then come in from the top or bottom. However, instead, the time bar at the top, as well as the background, are flying off screen, while that image is not. As you can see in the code, I tell "CurrentImage" to fly off screen and "NewImage" to drop in from the top, and I define those variables on lines 160-161.
currentScreen = screen1; currentImage = screenImage1; currentTimeBar = timeBar1
newScreen = screen2; newImage = screenImage2; newTimeBar = timeBar2
I also switch these variables on lines 382-400, within the function that moves the image.
//here, switch the currentScreen with the newScreen so that the process can be repeated
if newScreen == screen1 {
newScreen = screen2
newImage = screenImage2
newTimeBar = timeBar2
currentScreen = screen1
currentImage = screenImage1
currentTimeBar = timeBar1
} else {
newScreen = screen1
newImage = screenImage1
newTimeBar = timeBar1
currentScreen = screen2
currentImage = screenImage2
currentTimeBar = timeBar2
}
My problem is that this image is not moving, as one can see by running the code in an IOS Simulator.
I have attached the entire file of the code, and I hope that no one misuses it, as I trust the StackOverflow community. Please, this problem is on a very tight deadline and I would appreciate any attempt to assess the issue.
Thanks!
[All references to line numbers are in the GameScene.swift
file.]
The code can be found at the following URL: [Zip File Link to Code][1]
EDIT: It has come to my attention that a Dropbox link is not the best way of distributing code. However, I'm afraid I'm not well versed with GitHub, so I was not able to make the conversion. I apologize.
git clone
is far easier than downloading / uncompressing a zip file – Diego Freniche