This code enables an item, in this case my cat to move 10 steps in the direction according to what key is pressed.
eg. if you want it to go up, press the up arrow key
going down, press the down arrow key
going left, press the left arrow key
doing right, press the right arrow key.
Thus this enables your sprite to move what ever direction you want it to move by pressing the appropiate button.
No comments:
Post a Comment