Follow along at https://www.hackingwithswift.com/100/47.
This day covers the third and final part of
Project 11: Pachinko
in Hacking with Swift.I have a separate repository where I've been creating projects alongside the material in the book. And you can find Project 11 here. However, I also copied it over to Day 45's folder so I could extend from where I left off.
With that in mind, Day 47 focuses on wrapping up the project, and then extending it according to a set of challenges.
Not only is SKEmitterNode
an incredibly powerful class for creating particle effects — having SpriteKit generate and manage a set of nodes that are emitted as "particles", often in enormous quantities at an equally large velocity — Xcode also gives us an incredibly powerful editing tool for creating these effects in .sks
files. Fantastic 💥.
Our assets include other ball pictures rather than just “ballRed”. Try writing code to use a random ball color each time they tap the screen.
- 🔗 Commit
Right now, users can tap anywhere to have a ball created there, which makes the game too easy. Try to force the Y value of new balls so they are near the top of the screen.
Give players a limit of five balls, then remove obstacle boxes when they are hit. Can they clear all the pins with just five balls? You could make it so that landing on a green slot gets them an extra ball.
- 🔗 Commit