Description

In the project, we will use Photoshop and Unity as tools to respond to either: (1) a real world “Wicked Problem”; or (2) an existing fictional story that interests you. If choosing a fictional story, avoid stories that already exist as games.

Learning Resources

Reading

Unity:

Making sprites

Walk cycle animation

Example art

Requirements

  1. Create all work in the 2D game yourself, do not download or trace other artwork.
  2. Game must be comprised of an animated sprite character. The character does not have to be human.
  3. Sprite Sheet: Min of 4 poses in the walk cycle: Contact, up, passsing, and down in the ‘right’ (→) direction.

Tutorial

Set up character move and jump:

Downloads:

  1. Create 2D Unity project.
  2. Import 2D Standard Assets into your Unity file. Only the Standard assets are needed.
  3. Drag character ‘walk cycle’ and “environment” PSD sprites files. (Note: If you are getting white outlines around your sprites, use PNG file format instead of PSD.)
  4. Drag the walk cycle sprite file to the scene Hierarchy tab.
  5. With the object selected in the assets view, Select multiple from the Sprite Mode and then open the sprite editor.
  6. Click on slice in top left. Choose automatic or use the cell size you’ve previously prepared (34px in this example). This will create an animated sprite in your assets tab.
  7. Set the size of the sprite (34 pixels in my case).
  8. Create a GameObjectEmptyChild in the Hierarchy and rename to player.
  9. Drag the sprite walk sequence object onto the player object in the Hierarchy so it is parented to the the player object. Rename the sprite to playerWalking.
  10. Select the player object → Add Component and choose Box Collider 2d.
  11. Scale the box to fit over the top half of the sprite.
  12. With player selected, Add a Circle Collider 2d, scale to fit below the box covering the bottom of the sprite
  13. With player selected, Add rigidbody 2D.
    • Check lock rotation under constraints
  14. Create GameObjectEmptyChild and parent this to the player object.
  15. Rename to GroundCheck and reposition at bottom of character sprite (click on icon to add a color)
  16. Add player_move“** script to the player object.
  17. Add player_jump“** script to the player object.
  18. Drag groundCheck from Scene Hierarchy to player_jump slot called GroundCheck to connect them.
  19. On player_jump script properties, set ground as everything, and then uncheck “Player.” It should now say Mixed.
  20. With the player object selected, at the top choose layer and add two layers (“Player”, “Ground”, and “Background”).
  21. Set the character and children to “Player” layer (located at the top of the object properties).
  22. Add a ground sprite to the scene.
  23. Add a box collider 2d component to the ground object.
  24. Set the ground assets objects to “Ground” and the background assets to the “Background” layer. Change Order in Layer to -1 or higher to move objects visibly below the player.
  25. Adjust the framing of the game by adjusting main camera size. This is dependent.

Adding Animation to sprite

  1. Select parented playerWalking object (not the player object) object in hierarchy.
  2. Add a new animator component
  3. Drag the player_animation script to this object
  4. Open the animation window (Window → Animation)
  5. In Animation window, click “Create new”
  6. Unfurl the walk cycle in the assets window, and select all walk cycle sprites. Drag them into the animation window
  7. Change player animation samples to match your walk cycle and move speed (between 8 to 24 ish)

Adding audio

  1. Create audio source object (Right click, Audio → Audio Source) to the hierarchy.
  2. Drag audio_script from assets onto AudioSource object in the hierarchy.
  3. Drag the mp3 or other formatted audio file from assets into music clip slot.
  4. Drag the “AudioSource” object from hierarchy into music source slot.

Building

  1. Export to a MacOS File by choosing: File → Build settings
  2. Choose → macos → ensure scene is added to the build

Set up camera

  1. open/import 2d standard assets.
  2. drag camera2Dfollow script onto camera
  3. drag player into target field of script

Video Resources

Due dates:

Submission Instructions

  1. Watch learning resources for building a 2D Unity game and assets.
  2. Identify a project concept based on a fictional book, or story, or a wicked problem currently affecting the world.
  3. Produce a sprite sheet of a character walk cycle using Photoshop
    • Minimum 4 poses (contact, passing, contact, passing). Can have more than 4, see videos in learning resources.
    • Upload PSD character sprite sheet to Canvas.
    • Sprite Sheet Dropbox
  4. Produce a sprite sheet of environment assets using Photoshop
  5. Upload a video (captured with Quicktime) of your Unity project
    • Create a Quicktime video screen capture working game prototype. (Character walk cycle moving across environment asset)
      • File → New Screen Recording. Click record, select a record area, and click stop when done. Save as a .mov file.
    • Functional Unity Project Proof (video) Dropbox
  6. Upload Zipped Unity project file.