Advanced Unity 2D: Platformer Player Movement

Advanced Unity 2D: Platformer Player Movement

3h 20mAdvanced2016-07-05

Authors

Jesse Freeman

Jesse Freeman

Head of Partner and Framework Marketing at Amazon

Course details

Learn the foundation of player movement in 2d platformer games. This course offers a breakdown of common player behaviors as well as some advanced techniques to bring your 2D platformer to life. Jesse Freeman shows how to detect input from the keyboard and controller, make the player walk and run, and add in more advanced movement behaviors, such as ducks, double and long jumps, and sliding down walls. Plus, learn how to make your character pick up items and fire projectiles like fireballs.

Learning objectives
Building an input manager for keyboard and controllers
Setting up the player
Building reusable, self contained, and modular behaviors scripts
Adding behaviors: walking, running, and jumping
Managing animation states and player collisions
Adding a ducking animation
Detecting wall collisions
Sticking to, sliding down, and jumping off walls
Picking up items
Firing projectiles

Skills covered

Real-TimeGame DevelopmentUnityAdvancedVisualization and Real-TimeAECProduct and ManufacturingSoftware Development

Concepts

Introduction

  • Welcome
  • Using the exercise files

Working with Input

  • Input introduction
  • Building an input manager
  • Abstracting axis input
  • Building an input state class
  • Tracking button release states
  • Reading from the input state class
  • Building multiple input managers for multi-player games

Walking and Running

  • Setting up the first character
  • Building a test level
  • Building the abstract player behavior
  • Changing the direction the player is facing
  • Saving direction state
  • Adding walking to the player
  • Making the player run

Player Animations

  • Managing player animation states
  • Connecting player animation states

Managing Player Collisions

  • Working with script execution order
  • Building a collision state manager
  • Debugging player collision state

Jumping

  • Making the player jump
  • Limiting jump
  • Adding the jump animation
  • Adding double jump
  • Building a double jump effect
  • Adding long jump

Ducking

  • Adding ducking to the player
  • Adding the ducking animation
  • Disable other player behaviors when ducking

Wall Collision

  • Building walls for the test level
  • Detecting player wall collisions
  • Adding wall collision animation

Sliding Down Walls

  • Sticking to walls
  • Sliding down walls
  • Speeding up wall slide
  • Adding a wall slide effect

Jumping Off Walls

  • Making the player jump off walls
  • Cleaning up the wall jump
  • Testing out wall-to-wall jumping

Items

  • Picking up items
  • Equipping items
  • Changing animation based on item
  • Adding additional item animation states

Firing Projectiles

  • Creating a fireball
  • Destroying the fireball
  • Shooting the fireball projectile
  • Cleaning up the fireball projectile

Conclusion

  • Next steps
80,000 Toman