Using Starlogo TNG you can create keyboard controlled movement very simply.

We will look at two types of movement - First Person 3D movement, where you move forward using the up arrow and steer left or right using the left and right arrow keys, and 2D movement, similar to that used in 2D games like Pacman.

First Person 3D Movement

Start off by creating a procedure for movement.  This is what we want in the Turtles area:

Look at the video if you are not sure how to build it.

Setup SpaceLand

We need to ensure that SpaceLand is clear and only has one turtle.  Do this by creating a Setup block as below in the Setup workspace.

Create a Runtime Button and Test

Next we will move to the Runtime area and create a button to run our move procedure.

Add in the following:


2D Movement

In 2D movement the turtle moves up, down, left or right depending on which key is pressed, similar to the way a Pacman character is moved.  We do this by setting the heading for the turtle.  Heading directions can be seen in the diagram below.

To create 2D movement, change the Move procedure from above (leave everything else the same) to the following:

Create a very simple game using keyboard movement.