Top Down Example

By: My Class
17230 Plays

Move the player using the arrow keys.

The Player object is moved by setting its Velocity property directly. The velocity is set when a key is pressed, and reset to 0 when released.

Setting the velocity is preferable to setting the position directly, because this allows the collision detection to prevent the player from penetrating other objects.

Edit Game