Transitioning between scenes is easy in SpriteKit and can be done with minimal code. Learn how to create scene transitions and how to control their animations.
- [Instructor] So now that we've set up…a separate main menu scene, let's look…at transitioning from one scene to another.…If you remember, our GameScene.swift file…has some code to load in a new object,…so it's loading in a sprite called player_frame1,…which comes from the Assets folder.…So, let's say we want to transition…from the main menu into the game scene…when we click on the screen.…
So, let's head over to GameViewController.swift,…and in here, what I'm going to do is handle…the method touchesBegan, and I'll handle it…right underneath shouldAutorotate,…so about line 38, 39, you can handle touchesBegan.…This is going to be triggered whenever a touch happens,…so inside of here, all I need to do is just…copy and paste the code from above.…So if I scroll up and find the code…where we get the view and we load in the new scene,…I can copy that with Command C…and paste it inside touchesBegan with Command V.…
So, inside of here, I no longer need…these settings right here.…We don't need to change the view at all.…
- Creating a SpriteKit project
- Adding and modifying sprites
- Creating sprites in code
- Transitioning between scenes
- Working with children and parents
- Adding physics
- Detecting and responding to collisions
- Applying particle effects
- Creating actions
- Working with sound
- Adding cameras and lights
Skill Level Intermediate
Game Design Careers with Brenda Romerowith Brenda Romero54m 41s Beginner
Careers in the Game Industrywith Christian Bradley1h 19m Beginner
Building a Game App with the Android SDKwith David Gassner2h 6m Intermediate
1. Introduction to SpriteKit
2. Add Physics
3. Work with Particle Effects
4. Work with Actions
5. Work with Audio
6. Additional Features
Next steps1m 41s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.