Day 63
Day 63 ๊ด๋ จ
Project 17, part two
When you follow this course you are, in a way, following in my footsteps. I lay out a path for you to follow, showing you how to make a variety of apps and games, and give you tips and advice to help you stay on track.
But every couple of days comes a day like this one โ a day where there is no track laid down by me, and itโs down to you to go through my review questions and complete the challenges all by yourself.
These days are really important. As Mahatma Gandhi said, โAn ounce of practice is worth more than tons of preaching.โ Well, itโs time for the preaching to stop and for your practice to begin!
Today you should work through the wrap up chapter for project 17, complete its review, then work through all three of its challenges.
Wrap up
Wrap up
That's it! We just made a game in 20 minutes or so, which shows you just how fast SpriteKit is. I even showed you how per-pixel collision detection works (it's so easy!), how to advance particle systems so they start life with some history behind them, how to run code repeatedly using Timer
, and how to adjust linear and angular damping so that objects don't slow down over time.
Review what you learned
Anyone can sit through a tutorial, but it takes actual work to remember what was taught. Itโs my job to make sure you take as much from these tutorials as possible, so Iโve prepared a short review to help you check your learning.
Click here to review what you learned in project 17.
Challenge
One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try your new knowledge to make sure you fully understand whatโs going on:
- Stop the player from cheating by lifting their finger and tapping elsewhere โ try implementing
touchesEnded()
to make it work. - Make the timer start at one second, but then after 20 enemies have been made subtract 0.1 seconds from it so itโs triggered every 0.9 seconds. After making 20 more, subtract another 0.1, and so on. Note: you should call
invalidate()
ongameTimer
before giving it a new value, otherwise you end up with multiple timers. - Stop creating space debris after the player has died.
Wrap up - Additional
Thatโs another game finished, and in record time too โ make a video and show others!