Movement
Matthew salmon
(most) games have movement
Whether the game be top down, side scroller, or a 3D experience, many games have movement
It could be controlling a player, a car, or something completely different
We are going to focus on platformer movement today
(most) games have movement
Whether the game be top down, side scroller, or a 3D experience, many games have movement
It could be controlling a player, a car, or something completely different
We are going to focus on platformer movement today
What is a platforming game?
A platforming game typically has a player who can move around a world.
Players can typically move, jump, and perform other moves such as
This Photo by Unknown Author is licensed under CC BY-SA
Super smash bros, Nintendo™
What is a platforming game?
Why focus on movement?
In games, especially platformers, movement is the core mechanic that players will be using.
Putting work into getting core mechanics to feel good is one of the main features that makes a platformer feel good to play.
A platforming game typically has a player who can move around a world.
Players can typically move, jump, and perform other moves such as
Movement differs
Fast & snappy
drifty & floaty
Parts of a platformer toolkit
moving
Jumping
There are 2 main parts to a platformer’s movement
Parts of a platformer toolkit
moving
Key elements:
Parts of a platformer toolkit
moving
Key elements:
Parts of a platformer toolkit
Jumping
Key elements:
Parts of a platformer toolkit
Jumping
Key elements:
Coyote time demo
challenge
In groups, come up with:
For the examples following
Challenge 1
Acceleration – Deceleration - Top speed - Jump height – Jump speed - Gravity
Challenge 1 - Solution
Acceleration – fast
Deceleration – fast
Top speed – medium
Jump height – low/med
Jump speed – medium
Gravity – med/high
Challenge 2
Acceleration – Deceleration - Top speed - Jump height – Jump speed - Gravity
Challenge 2 - Solution
Acceleration – slow
Deceleration – slow
Top speed – high
Jump height – high
Jump speed – slow
Gravity – high
Challenge 3
Acceleration – Deceleration - Top speed - Jump height* – Jump speed* - Gravity
Challenge 3 - Solution
Acceleration – Med
Deceleration – fast
Top speed – very high
Jump height – *
Jump speed – *
Gravity – Medium
*jump height and speed depend on the player’s speed in this example
Extra bits
So how do I code it?
There’s a couple ways to code movement, but we will go over a very simple version.
Let’s start with some pseudocode...
So how do I code it?
REPEAT EVERY FRAME:
// get_x_input = value between -1 and 1
horizontal_movement = Get_X_INPUT()
// move side-to-side by this horizontal_movement
X_position = X_position + horizontal_movement
Let’s Try it!
So how do I code it? (Part 2)
REPEAT EVERY FRAME:
// get_x_input = value between -1 and 1
horizontal_movement = Get_X_INPUT()
// move side-to-side by this horizontal_movement
X_position = X_position + horizontal_movement
So how do I code it? (Part 2)
X_velocity = 0
Acceleration = 1 // 1 unit/s^2
REPEAT EVERY FRAME:
// get_x_input = value between -1 and 1
horizontal_movement = Get_X_INPUT()
// move side-to-side by this horizontal_movement
X_position = X_position + horizontal_movement
So how do I code it? (Part 2)
X_velocity = 0
Acceleration = 1 // 1 unit/frame^2
REPEAT EVERY FRAME:
// get_x_input = value between -1 and 1
horizontal_movement = Get_X_INPUT()
// increase x_velocity by acceleration
X_velocity += (horizontal_movement * acceleration)
// move side-to-side by this horizontal_movement
X_position = X_position + horizontal_movement
So how do I code it? (Part 2)
X_velocity = 0
Acceleration = 1 // 1 unit/frame^2
REPEAT EVERY FRAME:
// get_x_input = value between -1 and 1
horizontal_movement = Get_X_INPUT()
// increase x_velocity by acceleration
X_velocity += (horizontal_movement * acceleration)
// move side-to-side by X VELOCITY
X_position += X_VELOCITY
There’s a lot to movement
Even with all the code in the example, it still feels a bit crap
This Is where all the “extra techniques” come into play.
Are there any other features you’d add to make the character feel better?
There is no “right” way to make your movement
It all depends on the player’s experience and what fits best with your game
All the techniques shown here can be used as tools to make player movement feel the best possible
Everything is a tool
that being said, knowing where to start can be quite tricky.
My best advice is to look at games that have similar movement to what you’re aiming for.
I’m stuck?
Another great resource is the app “platformer toolkit”
It lets you play around with everything mentioned in these slides, and more (camera movement, polish, etc.)
I’m stuck?
Platformer toolkit on itch.io
Thank you
Any questions?