• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Enemy jumps up to the top of the screen [SOLVED]

Hi

I have an enemy object that follows a path, attacks a Dracula character when it collides with it and then destroys itself. That's how its supposed to happen anyway. Instead the enemy object attacks Dracula and then jumps up to the top of the screen. More enemies keep coming and they do what they are supposed to do, they attack Dracula and vanish.
 
N

Nathan Archer

Guest
It sounds like your path might be set to restart at the beginning after it's done, or you're accidentally creating a new object at (0, 0) when it's destroyed.
 
The path is set to continue. Its not creating a new object as far as I can tell.This is the path start:

Code:
path_start(path9, 5, path_action_stop, false);
The SimpleBrain is the enemy object. The collision is with DraculaInnerTube object. So, this is the collision code for SimpleBrain and Dracula's Inner Tube.

Code:
with(other) //castle in scope
{
    castle_timer--;

    if (castle_timer <= 0)
    {
        //attack the castle
        hp_minus = irandom_range(200, 200);
        global.castle_hp -= hp_minus;

        floater = instance_create_depth(x+10, y-10, -1700, DamageIndicatorObject);
        floater.text = string(hp_minus);
    
        castle_timer = room_speed;
        
        number_of_attacks++;
        if (number_of_attacks > 5)
        {
            with(other)
            {
                instance_destroy();
            }
        }
            
        //with (other)
        //{
        //    instance_destroy();
        //}
    }       
}
//probably the brain

    sprite_index = SimpleBrainAttack;
    path_speed = 0;
    speed = 0;
    //instance_destroy();
    path_speed = 0;
    speed = 0;
All the other brains work fine so I'm looking into their code but I'm stuck.
 
Top