Master Cabalist
Member
Hi
I have two characters. One is a snowman and another is a floating brain. The floating brain is supposed to halt when it runs into the snowman. However, it doesn't. It just moves right through him. I'm not sure what the problem is with the collision. The snowman (snowbat) is in the collision event in the floating brain (simple brain). I call path_speed = 0 at the beginning of the collision event so the brain should stop, right?
I have two characters. One is a snowman and another is a floating brain. The floating brain is supposed to halt when it runs into the snowman. However, it doesn't. It just moves right through him. I'm not sure what the problem is with the collision. The snowman (snowbat) is in the collision event in the floating brain (simple brain). I call path_speed = 0 at the beginning of the collision event so the brain should stop, right?
Code:
path_speed = 0;
global.timer_big_brain--;
show_debug_message("Simple Brain Snow Bat Collision");
if (global.timer_big_brain <= 0)
{
show_debug_message("Bat Collision INstance assigned");
//alarm[4] = room_speed;
show_debug_message("Collision message");
///bat scope (damag edealt to bat)
with (other)
{
//damage to batq
if (!global.group_invincibility)
{
hp = hp - 15;
damage = 15;
damage_dealt_to_bat = damage;
}
//alarm[5] = room_speed;
speed = 0;
under_attack = true;
took_a_hit = true;
sprite_index = SentryBatAttack;
}
//brain scope (damage to brain)
hp_minus = irandom_range(5, 20);
hp_minus = hp_minus / defense;
hp = hp - hp_minus;
speed =0;
under_attack = true;
took_a_hit = true;
sprite_index = SimpleBrainAttack;
global.timer_big_brain = room_speed*2;
show_debug_message("Showing Damage Indicator");
floater = instance_create_depth(x+10, y-10, -17000, DamageIndicatorObject);
floater.text = string(hp_minus);
}