Project 17 was a game in space where the user has to avoid objects coming their way.
Key Takeaways:
SKEmitterNode was used to set the background image of space with star particles. SKSpriteNode was used to display the player's spaceship image. SKLabelNode was used as the score label.
advanceSimulationTime() was used to give the effect of the star particles filling up the screen. This is a method of the emitter where you can simulate 10 seconds passing in the emitter and it will update the particles as if they were created 10 seconds ago.
Per-pixel collision detection is used when images you want to use are an irregular shape. The collisions are based on actual pixels from one object touching actual pixels in another.
-
Timer is used to run code after a period of time has passed, either once or repeatedly and it has five parameters:
- timeInterval: how many seconds you want the delay to be
- target: what object should be told when the timer starts
- selector: what method should be called on the object when the timer starts
- userInfo: any context you want to provide
- repeats: whether time should repeat
linearDamping was used to make the objects the user has to avoid in space consistently move across the screen. angularDamping was used to make the objects consistently rotate. They are both added to the physicsBody and set to zero.
Top comments (0)