Top Down Example

19157
19158
64
65

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.

Editor