In this video, Jesse Freeman teaches you how to add a simple game over effect to your endless runner game. You'll work with Unity's time class to slow down time and give the player a chance to realize what si going on before you let them restart the game. Learning how build a game loop in Unity 5 is an import skills for building a 2D game.
- View Offline
- Exercise Files
- [Voiceover] So now at this point,…when our player dies, we do turn off the spawner,…but everything else just seems to keep moving.…So one of the things that we want to do…is make everything stop.…Now, we can go through all the objects in the game…and either stop their velocity,…or in the cases of the background textures,…we can tell them to stop scrolling,…but that's a lot of work.…One of the easiest ways we can do this…is to actually manipulate time…and just tell the time scale to go to zero.…
That, in essence, would pause our game.…So as soon as the player dies, we'll pause our game.…Then, we can restart it by resetting time…back to its default value of one.…So let's take a look at how we can implement…a very basic time manager into our game.…Let's go into the scripts folder…and create a new C# script called TimeManager.…Let's open up the TimeManager in MonoDevelop,…and let's start adding in the logic we're gonna need.…
First, let's remove these two methods.…Next, let's create a public method called ManipulateTime.…
Start watching to learn how to convert artwork into sprites, create repeating background textures with Unity's TexturePacker, and build reusable game objects such as players, obstacles, and enemies. Jesse also covers the basics of object pooling, working with custom UI components, and multiplatform publishing.
- Importing artwork
- Editing sprites
- Creating repeating background textures
- Building reusable obstacles
- Recycling game objects
- Building an object pool
- Creating the player
- Starting and ending the game
- Displaying and saving the score
- Adding menus and text
- Publishing a Unity game in different formats
Skill Level Beginner
Advanced Unity 3D Game Programmingwith Michael House3h 45m Advanced
Unity 5 2D: Optimizing Graphicswith Jesse Freeman28m 2s Intermediate
1. Working with Sprites
2. Creating Repeating Textures
3. Creating Obstacles
4. Object Pooling
5. Creating the Player
6. Setting Up the Game
7. Polishing the Game
8. Creating More Obstacles
Publish to different formats5m 42s
- 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.