Skip to content

mbaranowski/SpriteKit-Platformer-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swift SpriteKit Platformer Tutorial

WARNING: This project is being actively rebased and force-pushed to keep the history corresponding to stages in the tutorial. But feel free to fork and give feedback.

A simple 2d platformer game tutorial written in Swift 2.1, running as an OSX app, using SpriteKit. Heavily Based on the excellent RayWenderlich.com SpriteKit platform tutorial but rewritten in idiomatic Swift. Uses excellent art resources from kenney.nl. Uses a slightly modified JSTileMap to load maps created in TileEd

To Play:

  • A - move Left
  • D - move Right
  • Space - Jump!

or rewrite GameScene's keyDown & keyUp method.

Each commit is a snapshot of game progress that illustrates various mechanims and for a live tutorial can be replayed by checking out each commit in order.

  1. Initial Commit - XCode project setup based on the default SpriteKit with all art assets included, utility code and JSTileMap
  2. Load tile map - GameScene now loads and displays the included map.tmx file.
  3. Add Player Class - Added a Player class and adds it to the GameScene as a static sprite
  4. Add skeleton update - Add update method on Player and GameScene classes
  5. Player Update - implement a very simple physics simulation for the player sprite
  6. Handle Collision - adds collision resolution to make sure player doesn't fall through walls
  7. Keyboard Controls - you can now contorl the player using the keyboard
  8. SetViewPointCenter - the view now moves with the player
  9. onPlayerDied - when player falls off the world, go back to start

[To Be Continued...]

About

A simple 2d platformer game tutorial written in Swift 2.1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published