Join Todd Perkins for an in-depth discussion in this video Transition between scenes, part of iOS Game Development with Swift 2.0 and SpriteKit.
- So when you have multiple scenes in your game,…you need some way to transition between those scenes.…For example, transition from the main menu…to the actual game and back.…Let's look at how that works.…I'll click on MainMenu.swift…and we'll write the code in here.…I'm going to override the method touchesBegan and then,…inside of here, we don't care where the touch was,…we just want to transition to the game scene.…So we'll define the game scene,…which will be of the type GameScene,…and I'll create the new game scene…with the constructor fileNamed…and then pass in GameScene.…
Now we're seeing a problem here…on the left side of the screen,…and when we click on that, we get a fix-it suggestion.…It's saying that this is an optional.…Do you want to use a exclamation point or a question mark?…I'm just going to click on fix-it…and I'm going to use an exclamation point…and unwrap that forcefully because I know that I have…the game scene and that it's going to exist.…Just note that, if you don't know…for sure if this is going to work,…
- Creating a new SpriteKit project
- Adding and modifying sprites
- Transitioning between scenes
- Removing child sprites from parents
- Working with gravity, forces, and impulses
- Detecting collisions
- Applying particle effects
- Creating actions and action sequences
- Working with audio
- Creating frame animations
- Using cameras and lights
Skill Level Intermediate
1. Introduction to SpriteKit
2. Add Physics
3. Work with Particle Effects
4. Work with Actions
Use an action sequence4m 8s
5. Work with Audio
6. Additional Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.