O'Reilly logo

Learning Unity 2D Game Development by Example by Venita Pereira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The ninja character

Our ninja character needs to be an animated sprite that loops infinitely. The position of the ninja will remain static as we will move the background and foreground to give the illusion of movement.

To create our character, we execute the following steps:

  1. Add a folder to Assets within the Project Browser named Ninja.
  2. Download and unzip the image NinjaSpriteSheet.png from http://freeartsprites.com/free-art/endless-runner/.
  3. Slice the sprite sheet into individual animation sprites.
  4. Create a sprite GameObject using the following image:
    The ninja character
  5. Name the GameObject Ninja.
  6. We then go to Add component | Physics 2D | Box Collider 2D.

Running

As we are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required