Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Swift invaders - a Space Invaders clone for Swift 3 in 200 lines

296 views

Published on

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

Published in: Mobile
  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Swift invaders - a Space Invaders clone for Swift 3 in 200 lines

  1. 1. Dallas App Developers, WELCOME! App Dev Lightning Talks May the 4th be with you, 2017
  2. 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. 3. Swift 3 ❖ Programming language to make iOS apps in Xcode ❖ Runs on iOS 10 and Newer ❖ Apple’s simplified replacement for Objective-C
  4. 4. Swift Invaders Demo
  5. 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. 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.
  7. 7. Game loop
  8. 8. 5 Coding shortcuts ❖ Declaring variables ❖ Loops ❖ 4 lines for every pixel art game ❖ Collisions (Presentation frames) ❖ Built-in states
  9. 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.
  10. 10. Loops Conditional logic expands the use of your loops and arrays of any variable type reduce scripting redundancies
  11. 11. 4 lines for every pixel art game This makes every subview retain its hard pixel edge for any size.
  12. 12. Collisions (1 of 2) All animated UIImageViews have a presentation frame.
  13. 13. Collisions (2 of 2)
  14. 14. Built-in States UIButtons have built-in highlighted, enabled, disabled, focused, etc. states.
  15. 15. Swift Invaders https://github.com/NickCulbertson/Swift-Invaders- Game

×