Adding Turning Movements
rYou might not choose to do this, but I want to show you thatâs itâs another option for you to think creatively about what youâre trying to accomplish. Here is what weâre going to attempt:
- Our player is always moving.
- Like a race car, we can turn the wheel right or left.
We might consider something like this:
when green flag clicked
forever
if <key [right arrow v] pressed?> then
turn cw [1] degrees
end
if <key [left arrow v] pressed?> then
turn ccw [1] degrees
end
move [1] steps
end
Go ahead and take it for a spin. Like I said, you could see this mechanic being super interesting for a racing game, for example.
Now that we have a moving character, we probably want to give him something to move towards, right? Letâs randomly place a prize for our player to find.