Add juice to your game to help set it apart from all the rest.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3875-how-to-make-a-game-like-flappy-bird/lessons/12
Add juice to your game to help set it apart from all the rest.
Okay, so I noticed on this version of flappy bird (using swift 2), there is no longer an upper boundary. As of now my bird can fly over all of the obstacles. I have watched the past videos with Ray, and used to code he used to add an upper boundary, but this code does not work in swift 2. I was wondering how it is possible to add the upper boundary. The previous code was:
playerNode.position = CGPoint(x: playerNode.position.x, y: min(playerNode.position.y, size.height))
Thanks!
Missing the rest of the function, but at some point you calculate the new Y coordinate, you should put that in the min function as in:
min(newY, size.height).
Other than that the could should still be valid, the min function was not changed.
Sorry, a little late to respond here; I must have missed the notification. Anyway, this was actually addressed early on; you can read through the Twitter thread for some more information: https://twitter.com/_adrfer/status/696396313294929921
How can I run the project without using storyboard? I thank if I just setup rootViewController in AppDelegate to GameViewController all will work without storyboard, but I only see black screen. Help, please!
@shogunkaramazov I have already solved the problem by changing the scene setup code in the GameViewController