N
Nahual
Guest
I'm so glad and beyond happy that the GMC is back!
Now if you guys could help me a bit here with this issue that is killing me
I'm trying to make the player (main character) to do a full animation and when it reaches "frame number 5" then releases a missile, all of this is part of a power-up.
Everything works, the missile is created and it travels how it supposed to, what it doesn't work is the animation, for some reason the animation doesn't play all the way through and is breaking my skull not being able to fix it.
The code is in the STEP event of the player.
Here's what I have coded:
Now if you guys could help me a bit here with this issue that is killing me
I'm trying to make the player (main character) to do a full animation and when it reaches "frame number 5" then releases a missile, all of this is part of a power-up.
Everything works, the missile is created and it travels how it supposed to, what it doesn't work is the animation, for some reason the animation doesn't play all the way through and is breaking my skull not being able to fix it.
The code is in the STEP event of the player.
Here's what I have coded:
Code:
CREATE EVENT
///initialize variables
image_speed = .2;
grav = 1;
spd = 4;
jspd = 12;
hspd = 0;
vspd = 0;
b = -1; //bullet
c = -1; //bullet
d = -1; //gun spark
e = -1; //gun spark
f = -1; //fua powerup
canshoot = true;
hurt = 0;
Code:
STEP EVENT
//powerup
if (fkey) && (obj_controller.tequila = 3){
sprite_index = spr_player_power;
image_speed = 1;
alarm[2] = 40;
if (image_index > 5){
audio_play_sound(snd_fua,9,false);
f=instance_create(x+sign(image_xscale) * 8,y-2,obj_fua);
f.speed = 15;
obj_controller.tequila = 0;
// powerup facing
if (image_xscale = 1){
f.direction = 0;
}else{
f.image_xscale = -1;
f.direction = 180;
}
}
}
Last edited by a moderator: