Monday, 22 October 2012
Key moves
With this algorithm the cats move around as the arrow keys are prssed.
The cats turn exactly 90* when changing directions from up to left or right OR down to left or right.
If the controller pressen up then down/down then up OR right then left/ left then right the character turns exactly 180*
I've set the algorithms for both of the cats, so they follow each other around.
The cats only move around if the arrows are pressed, this is because i set it so the character faces a certain direction and moves forward if i press either the up, down, left or right arrow.
When the 'up arrow' is pressed the cats point in 0* (which is north/up) and moves 10 steps.
When the 'down arrow' is pressed the cats point in 180* (south/down) and moves 10 steps.
When the 'left arrow' is pressed the cats point -90 (west/ left) and moves 10 steps.
When the 'right arrow' is pressed the cats point 90 (east/right) and moves 10 steps.
The yellow blocks and 'contol' blocks, they provide a means of command for the controler. Then the bluse block (which are motion block) provide intrustions for the character (how it is to move).
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment