Skip to main content
2 of 3
added 161 characters in body

Have you thought about adding negative velocity and using a ternary statement to decide what to add?

if(keys.up != keys.down) {
  acceleration.add(0, keys.up ? 0.001 : -0.001);
  velocity.add(acceleration);
  location.add(velocity);
}

EDIT: What platform are you using?