Using arrowkey to move rocket
Posted: Sun Apr 15, 2012 1:36 am
I want to use the arrowkeys to move the rocket up and down and left and right. I can do it on a card by itself but when I put it in the "on updateScreen" block of code, it keeps giving errors (card "rocket": compilation error at line 28 (if: error in command) near "on", char 1).
What am I doing wrong or what should I be using?
This is from Game Academy - Lesson one where I want to use the arrow keys instead of just the mouse to move the rocket.
The code is
on updateScreen
if the mouse is down then
....
end updateScreen
I want to put the following code in
on arrowkey x
if x = "up"
.....
end updateScreen
It works on a card by itself but not in this case. I can use the arrow keys to move the rocket, up/down/left/right with the full code. But how do I get that functionality to work in the updateScreen code? Any ideas?
Thank you
What am I doing wrong or what should I be using?
This is from Game Academy - Lesson one where I want to use the arrow keys instead of just the mouse to move the rocket.
The code is
on updateScreen
if the mouse is down then
....
end updateScreen
I want to put the following code in
on arrowkey x
if x = "up"
.....
end updateScreen
It works on a card by itself but not in this case. I can use the arrow keys to move the rocket, up/down/left/right with the full code. But how do I get that functionality to work in the updateScreen code? Any ideas?
Thank you