D
diester
Guest
Hello,
after being confronted with too much collision problem I recommed
I made my new project by basing on this tutorial:
all goes well at the level of collisions between the player's walls and the o_solid object that is destroyed by a bomb.
the problem is that my character does not lose his life if he enters in collision with the explosion of the bomb when he should.
however, I use the basic system:
to define the life of the player in script scr_InitializePlayer:
in collision obj_ boom ( who is the explosion ) in oPlayer :
in step oPlayer :
I create a life bar that does not go down because the collision is not made.
the collisions are well defined in each sprite.
I check if this was a problem of layer but I think rather a conflict with the scripts ???
Any ideas
after being confronted with too much collision problem I recommed
I made my new project by basing on this tutorial:
all goes well at the level of collisions between the player's walls and the o_solid object that is destroyed by a bomb.
the problem is that my character does not lose his life if he enters in collision with the explosion of the bomb when he should.
however, I use the basic system:
to define the life of the player in script scr_InitializePlayer:
Code:
jumpKey = global.jumpKey;
rightKey = global.moveRightKey;
leftKey = global.moveLeftKey;
shootKey = global.shootGunKey;
max_health_ = 25;
health_ = max_health_;
maxRunSpeed = 4.8;
maxFallSpeed = 12;
maxJetSpeed = 4;
xSpeed = 0;
ySpeed = 0;
frict = .2;
accel = .4;
weight = .5;
jetPower = .12;
jumpPower = 10;
vertState = verticalstate.onGround;
Code:
health_ -= 5;
Code:
if (health_ <=0)
{
instance_destroy(bb)
game_restart();
}
Code:
draw_self();
if !instance_exists(oPlayer) exit;
draw_health_ = lerp(draw_health_, oPlayer.health_, .25);
draw_set_color(c_red);
draw_rectangle(x+4, y+4, x+123*draw_health_/oPlayer.max_health_, y+11, false);
draw_set_color(c_white);
I check if this was a problem of layer but I think rather a conflict with the scripts ???
Any ideas
Last edited by a moderator: