Skip to content

Instantly share code, notes, and snippets.

@nklsrh
Created July 10, 2013 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nklsrh/5962974 to your computer and use it in GitHub Desktop.
Save nklsrh/5962974 to your computer and use it in GitHub Desktop.
// move left
if (Key.isDown(Key.A))
{
// if paddle is not touching the side of table
// we move
if (paddle1.position.y < fieldHeight * 0.45)
{
paddle1DirY = paddleSpeed * 0.5;
}
// else we don't move and stretch the paddle
// to indicate we can't move
else
{
paddle1DirY = 0;
paddle1.scale.z += (10 - paddle1.scale.z) * 0.2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment