1 of 7

Platformer Game

2 of 7

Velocity

forever

move (velocity) steps

wait (vtime) seconds

How would you add in a vertical velocity?

[This means only changes y coordinate.]

3 of 7

Gravity

Add a variable: vertical velocity

If touching floor color

-- set vertical velocity to 0

else

-- change vertical velocity by gravity

4 of 7

Glitches to Discuss

  • Character can't escape floor (stuck inside)�
  • Character falls deep into floor�
  • Character seems ok on platform, but falls too fast when it walks off the edge.

5 of 7

Jumping

How do you jump?

6 of 7

Slowing Down: Friction or Skid Stop

Ways to slow down:

  1. velocity = velocity - small number
  2. velocity = 0.99 * velocity

Issues with #1: negative velocity doesn't work.

7 of 7

Game Requirements

  • Platformer
  • Jump (no more than double jump)
  • Skid stop horizontally
  • Score, Win
  • Multiple Levels or Side Scrolling