Join Jesse Freeman for an in-depth discussion in this video Adding the player, part of Unity 5: 2D Essential Training (2015).
- Now that we have the basics of our game manager in place,…let's look into how we can set up our game.…We're gonna create a method called Reset Game…that'll get called whenever you want to create a new game.…In this case, it's simply gonna turn the spawner on…and we're gonna get a reference of the player…either from the object pool or have the object pool…create a new player for us.…First, let's select the player instance in the scene.…And select Apply to it's prefab to make sure…that any changes we've made are now saved to the prefab.…
Then, we're gonna delete it from the scene.…Next, let's select the Game Manager…and double-click on the Game Manager script…to open it up in Model Develop.…At this point, we now know that the floor and the spawner…are going to work by getting our reference…during the awake method.…So let's make these two properties private…so we don't see them in the Inspector.…Above this, we're gonna need a reference…to the player prefab so we can actually create it…when we reset our game.…
This we're gonna want to make as a public GameObject…
Super Zombie Runner riffs off the popular endless runner genre: a one-button casual game that's not only fun to play but exciting to build. The focus of the work is a reusable code base that you can extend and make your own, while learning the basics of object pooling, supporting multiple screen resolutions, tracking scoring, and multi-platform publishing. Along the way, Jesse covers key Unity features, such as working with sprites, creating animations, and leveraging the UI components.
- Working with sprites and animation
- Creating the player
- Spawning GameObjects
- Adding obstacles and collisions
- Building the game objects and logic
- Managing game state
- Creating pixel-perfect cameras
- Designing for multiple screen resolutions
- Adding scores
- Optimizing performance
- Publishing to desktop, web, and mobile platforms
Skill Level 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. Adding UI
8. Creating More Obstacles
- 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.