L
Larukuchi
Guest
Hi guys,
I facing an issue since yesterday and I can't figure out how to solve it ...
I hope someone will be able to help me
I would like to say that I'm a a beginner with Game maker.
This is my problem :
My player have multiple states set by enum in its create event.
One of my state is player.bomb allowing the player to shoot a fire ball like a bullet, and this the code inside :
The behavior is ok, but the sprites showing the animation of the player shooting isn't ok, I mean we just can see one frame on six normally set in the sprite lookup table corresponding to the player.bomb state.
If I ad this code before "state_ = player.move", the animations will be fine but the bullet are now multiplied by x and the player get stuck in the animation.
Have some ideas ?
I facing an issue since yesterday and I can't figure out how to solve it ...
I hope someone will be able to help me
I would like to say that I'm a a beginner with Game maker.
This is my problem :
My player have multiple states set by enum in its create event.
One of my state is player.bomb allowing the player to shoot a fire ball like a bullet, and this the code inside :
Code:
/// @description Bomb state
var _bullet = instance_create_layer(x, y-10, "Instances", o_bomb);
audio_play_sound(a_set_bomb, 5,false);
image_speed = 1;
if direction_facing_ == dir.up {
_bullet.image_angle = 90;
_bullet.direction = 90;
}
if direction_facing_ == dir.right {
_bullet.image_angle = 360;
_bullet.direction = 360;
}
if direction_facing_ == dir.down {
_bullet.image_angle = 270;
_bullet.direction = 270;
}
if direction_facing_ == dir.left {
_bullet.image_angle = 180;
_bullet.direction = 180;
}
state_ = player.move;
The behavior is ok, but the sprites showing the animation of the player shooting isn't ok, I mean we just can see one frame on six normally set in the sprite lookup table corresponding to the player.bomb state.
If I ad this code before "state_ = player.move", the animations will be fine but the bullet are now multiplied by x and the player get stuck in the animation.
Code:
if animation_hit_frame(-1){
state_ = player.move;
}