Join Jesse Freeman for an in-depth discussion in this video Displaying the score, part of Unity 5: 2D Essential Training (2015).
- Now that we have the continue text done,…it's time for us to move over to the text…that'll hold our score and high score.…We're gonna keep track of the time…that the player stays alive.…We'll have the best time as well…and that'll be our high score.…Now let's create a new text object…and we'll see that it's starting to…get a little crowded here, so let's name…the first text object Continue Text.…And we'll name this new one Score Text.…
Next, we'll want to set up the score text…to look like how our high scores will eventually be…when we're rendering it out from the code.…First, let's add the words Time and set up a basic time,…and then next, we'll do Best,…and we'll set up another time value as well.…Here you'll see that since the text is expanding…out past the size of the actual text field,…it's being cut off.…Now this won't be a problem in a minute…because we're going to actually lower the font size…and change the font in general,…but if you run into problems in your own game,…you can change the horizontal overflow…
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?
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.