Swift invaders - a Space Invaders clone for Swift 3 in 200 lines
These are the slides from a talk on making a Space Invaders clone using Swift 3. This is for educational purposes.
Get it here: https://github.com/NickCulbertson/Swift-Invaders-Game
2. Swift Invaders
• Swift 3
• 200 lines of code
• Game loop
• 5 Coding shortcuts
• Creative coding
https://github.com/NickCulbertson/Swift-Invaders-Game
(Example of each feature implemented)
3. Swift 3
❖ Programming language to make iOS apps in Xcode
❖ Runs on iOS 10 and Newer
❖ Apple’s simplified replacement for Objective-C
5. 200 Lines
❖ Limiting lines of code is not a requirement for writing
good code
❖ Constraints can make the creative process more fun
(example: Pico 8)
6. Game loop
❖ Basics:
❖ Open app
❖ Start game
❖ Win/Lose game
❖ Loop
❖ Also good to include: Menus, Settings, Credits, Game
Center, Ad Integration, IAP, etc.
8. 5 Coding shortcuts
❖ Declaring variables
❖ Loops
❖ 4 lines for every pixel art game
❖ Collisions (Presentation frames)
❖ Built-in states
9. Declaring variables
You can assign values while declaring, most variable types can
hold an array, and declare multiple variables of a type on 1 line.