Video Tutorial: How To Make a Game Like Flappy Bird in Swift Part 4: Spawning Obstacles

Learn how to spawn obstacles in your game, in this case cacti that move across the screen creating a challenge for the player. By Ray Wenderlich.

Leave a rating/review
Save for later
Share

Contents

Hide contents

Video Tutorial: How To Make a Game Like Flappy Bird in Swift Part 4: Spawning Obstacles

1 min

Challenge

Your challenge is to:

  • Add a sombrero sprite on top of Felipe’s head (add the sombrero sprite as a child sprite of _player)
  • Upon a flap, move the hat up 12 pixels over 0.15 seconds (using ease in/ease out timing mode), and then reverse the action

Please Note: The artwork in this game is by Mike Berg at weheartgames.com. He’s a great guy, highly recommended btw! :] You have permission to use the code from this game in your own apps, but you do not have permission to use the artwork.

Download lecture slides

Download demo starter

Download demo finished

Download challenge finished

View next video: Physics Shapes
View previous video: Moving The Background

We’ve added a new feature to our newest videos, English subtitles! You can now click the ‘CC’ button in the video player bar to turn subtitles on or off.

Contributors

Over 300 content creators. Join our team.