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
- Create all work in the 2D game yourself, do not download or trace other artwork.
- Game must be comprised of an animated sprite character. The character does not have to be human.
- 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:
- Create 2D Unity project.
- Import 2D Standard Assets into your Unity file. Only the Standard assets are needed.
- 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.)
- Drag the walk cycle sprite file to the scene Hierarchy tab.
- With the object selected in the assets view, Select multiple from the Sprite Mode and then open the sprite editor.
- 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.
- Set the size of the sprite (34 pixels in my case).
- Create a GameObject → EmptyChild in the Hierarchy and rename to player.
- 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.
- Select the player object → Add Component and choose Box Collider 2d.
- Scale the box to fit over the top half of the sprite.
- With player selected, Add a Circle Collider 2d, scale to fit below the box covering the bottom of the sprite
- With player selected, Add rigidbody 2D.
- Check lock rotation under constraints
- Create GameObject → EmptyChild and parent this to the player object.
- Rename to GroundCheck and reposition at bottom of character sprite (click on icon to add a color)
- Add player_move“** script to the player object.
- Add player_jump“** script to the player object.
- Drag groundCheck from Scene Hierarchy to player_jump slot called GroundCheck to connect them.
- On player_jump script properties, set ground as everything, and then uncheck “Player.” It should now say Mixed.
- With the player object selected, at the top choose layer and add two layers (“Player”, “Ground”, and “Background”).
- Set the character and children to “Player” layer (located at the top of the object properties).
- Add a ground sprite to the scene.
- Add a box collider 2d component to the ground object.
- 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.
- Adjust the framing of the game by adjusting main camera size. This is dependent.
Adding Animation to sprite
- Select parented playerWalking object (not the player object) object in hierarchy.
- Add a new animator component
- Drag the player_animation script to this object
- Open the animation window (Window → Animation)
- In Animation window, click “Create new”
- Unfurl the walk cycle in the assets window, and select all walk cycle sprites. Drag them into the animation window
- Change player animation samples to match your walk cycle and move speed (between 8 to 24 ish)
Adding audio
- Create audio source object (Right click, Audio → Audio Source) to the hierarchy.
- Drag audio_script from assets onto AudioSource object in the hierarchy.
- Drag the mp3 or other formatted audio file from assets into music clip slot.
- Drag the “AudioSource” object from hierarchy into music source slot.
Building
- Export to a MacOS File by choosing: File → Build settings
- Choose → macos → ensure scene is added to the build
Set up camera
- open/import 2d standard assets.
- drag camera2Dfollow script onto camera
- drag player into target field of script
Video Resources
Due dates:
- Oct 19 at 2:30pm: Project concept Dropbox
- Oct 19 at 2:30pm: Sprite Sheet Dropbox
- Oct 26 at 2:30pm: Environment Assets Dropbox
- Nov 2 at 2:30pm: Functional Unity Project Proof (video) Dropbox
- Nov. 9 at 2:30pm: Finished Game Dropbox
Submission Instructions
- Watch learning resources for building a 2D Unity game and assets.
- Identify a project concept based on a fictional book, or story, or a wicked problem currently affecting the world.
- Submit in .txt or .doc format
- Project concept Dropbox
- 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
- Produce a sprite sheet of environment assets using Photoshop
- Upload PSD environment assets to Canvas.
- Environment Assets Dropbox
- 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.
- File → New Screen Recording. Click record, select a record area, and click stop when done. Save as a
- Functional Unity Project Proof (video) Dropbox
- Create a Quicktime video screen capture working game prototype. (Character walk cycle moving across environment asset)
- Upload Zipped Unity project file.
- Zip file that includes an executable
- Finished Game Dropbox