F
Florian
Guest
Hi there,
I recently started goofing around on GMS2.
Currently working on a roguelike project, my first incomprehension came with damage calculation.
Right now it's overly simple : each time I bump into the enemy he loses 5HP.
So I have something like :
hp_enemy -= 5 ;
if (hp_enemy <= 0)
{
instance_destroy(obj_enemy) ;
}
Everyrhing works just fine, except that in fact the enemy loses 10HP :
hp_enemy = 20 in the create event, and he dies in 2 hits instead of 4.
I skipped that part for a moment and moved on.
Now improving the combat system I started using random values.
But when using random(100) or random_range(0,100) the value always stay <=50.
What am I doing wrong here ?
I find it strange to systematically have a x2 error factor in everything I try.
Thanks by advance for any kind of advice here !
I recently started goofing around on GMS2.
Currently working on a roguelike project, my first incomprehension came with damage calculation.
Right now it's overly simple : each time I bump into the enemy he loses 5HP.
So I have something like :
hp_enemy -= 5 ;
if (hp_enemy <= 0)
{
instance_destroy(obj_enemy) ;
}
Everyrhing works just fine, except that in fact the enemy loses 10HP :
hp_enemy = 20 in the create event, and he dies in 2 hits instead of 4.
I skipped that part for a moment and moved on.
Now improving the combat system I started using random values.
But when using random(100) or random_range(0,100) the value always stay <=50.
What am I doing wrong here ?
I find it strange to systematically have a x2 error factor in everything I try.
Thanks by advance for any kind of advice here !