Make a string actor variable called "right"
1. Player :
Keydown>Left>
- Code: Select all
right=0;
x-=3;
ChangeAnimation("Event Actor", "PlayerWalkLeft",FORWARD);
Keydown>Right>
- Code: Select all
right=1;
x+=3;
ChangeAnimation("Event Actor", "PlayerWalkRight",FORWARD);
Keyup>Left
- Code: Select all
ChangeAnimation("Event Actor", "PlayerStopLeft",FORWARD);
Keyup>Right
- Code: Select all
ChangeAnimation("Event Actor", "PlayerStopRight",FORWARD);
Keydown>Shoot
- Code: Select all
if(right==0)
{
ChangeAnimation("Event Actor","PlayerShootLeft",FORWARD);
}
if(right==1)
{
ChangeAnimation("Event Actor","PlayerShootRight",FORWARD);
}
//CreateActor>Ammo
2. Ammo
CreateActor>
- Code: Select all
if(Player.right==0)
{
angle=180;
}
if(player.right==1)
{
angle=0;
}
directional_velocity=15;