i have the bullets working and killing people but i was wondering how to get the bullets to shoot the way i am facing
ex. left-bullet goes left same with right
but all i can do is go one direction per game plz help
Hblade wrote:Put 2 variables, called standingright and standingleft, then when key right is pressed, standing right is 1 anmd standing left is 0, when left is pressed, standing left is 1, standing right is 0 No wait, have thos on Key up and key down
DST wrote:You can do it with just one variable.
Add the keydowns for it in counterclockwise order, starting at right.
so keydown right>
dir=0;
keydown up>
dir=1;
keydown left>
dir=2;
keydown down>
dir=3;
you don't need a keyup event. Usually you want your character or gun to stay facing the last direction pushed.
Now you can use dir for angle as well, where angle=dir*90, since right is 0 and up is 90, etc. in the GE coordinate plane.
angle=creator.dir*90;
Users browsing this forum: No registered users and 1 guest