Join Jesse Freeman for an in-depth discussion in this video Cleaning up the obstacles, part of Unity 5 2D Essential Training (2015).
- Now, we're gonna create a script…that will manage our obstacle.…We want it to actually change randomly to different sprites.…This way it looks different each time…it's spawned out.…This will also be a good way for us to implement iRecycle…interface that we just used,…so that every time a new instance is created,…instead of relying on having to instantiate it from scratch,…we'll take advantage of the fact that the object pool…will automatically call restart and shut down…so every time a new obstacle is restarted,…we'll randomly pick a new sprite and display…that instead.…
Let's go into our "Script" folder, and create…a new class called "Obstacles."…And then we'll open this up in MonoDevelop.…So the first thing we're gonna wanna do,…is implement our interface for iRecycle.…We can do this by adding a comma, after MonoBehavior,…and typing in iRecycle.…Now if we were to save this script,…and go back over to Unity, you'll start seeing an error.…If we look at the console, you'll see that "obstacles"…does not implement the interface member "irecycle restart,"…
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.