Groups | Blog | Home
all groups > flash actionscript > august 2005 >

flash actionscript : How do i make the symbol move forward


spudless
8/3/2005 11:07:04 PM
I need to know the actionscript for making the symbol move in the direction
that it is facing when up is pressed and how to make it rotate 90 degrees when
left or right is pressed. The code i'm using now is
on(keyPress "<Left>"){
tank._x = tank._x - 10;
}
////////
on(keyPress "<Right>"){
tank._x = tank._x + 10;
}
////////
on(keyPress "<Up>"){
tank._y = tank._y - 10;
}
////////
on(keyPress "<Down>"){
tank._y = tank._y + 10;
}

Please help a poor newbie
Jeckyl
8/4/2005 12:00:00 AM
on(keyPress "<Left>"){
tank._rotation += 90;
}
on(keyPress "<Right>"){
tank._rotation += 90;
}
on(keyPress "<Up>"){
tank._y -= 10; // Assuming the tank is facing upwards ...
}
--
Jeckyl

AddThis Social Bookmark Button