I am going to kill myself...
Posted: Wed Jan 14, 2009 4:10 pm
.....if this dosen't work. I have four key down events for a tank in my game. Each key down event triggers a script editor action and each key is as follows:
When I press any key on its own, it moves in the right direction but only fires across the screen in one direction, travelling right. It should fire in all four directions! And, to make matters worse, when I press two keys at the same time, THE TANK FLIES AROUND THE SCREEN AND I CANNOT STOP IT FROM MOVING, AS IF IT HAS VELOCITY!
Please help or I will jump of a cliff!
- Code: Select all
For the tank:
(Key Down/up/Script Editor/ At least one key is pressed, repeat)
y=y-5;
ChangeAnimation ("Event Actor", "bluetank", FORWARD);
angle = 90;
(Key Down/down/Script Editor/At least one key is pressed, repeat)
y=y+5;
ChangeAnimation("Event Actor", "bluetank down", FORWARD);
angle = 270;
(Key Down/left/Script Editor/At least one key is pressed, repeat)
x=x-5;
ChangeAnimation("Event Actor", "bluetank left", FORWARD);
angle = 180;
(Key Down/right/Script Editor/At least one key is pressed, repeat)
x=x+5;
ChangeAnimation("Event Actor", "bluetank right", FORWARD);
angle = 0;
When the tank fires, it creates a cannonball actor.
For the cannonball that the tank fires:
(Create actor/Script editor)
angle = creator.angle;
directional_velocity = 10;
When I press any key on its own, it moves in the right direction but only fires across the screen in one direction, travelling right. It should fire in all four directions! And, to make matters worse, when I press two keys at the same time, THE TANK FLIES AROUND THE SCREEN AND I CANNOT STOP IT FROM MOVING, AS IF IT HAS VELOCITY!
Please help or I will jump of a cliff!