• 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!

Windows Problem with enemy spawn

P

Prandini

Guest
I try to do a functional spawn of enemies using a timer, everything works, however, a bug happens where the sprite of my player and the enemy appears continuously, even if I didn't put this in the code
GML:
var enemy = instance_create_depth(irandom_range(48,442), 0, 1, obj_enemy);
enemy.sprite_index = choose(spr_enemy, spr_enemy1);
alarm[0] = 60*4;
 

Attachments

Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Please post programming issues in the correct forum (I have moved this post) and please post in English, even if it's using Google Translate.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
ok, it was a mistake of mine I'm sorry
No worries!

I try to do a functional spawn of enemies using a timer, everything works, however, a bug happens where the sprite of my player and the enemy appears continuously, even if I didn't put this in the code
Does your room have a background? Even if it's a colour? If the room has no background layer, then the display buffer won't be cleared every step and so you get a "trail" effect much like the one that is shown in that image.
 
P

Prandini

Guest
No worries!


Does your room have a background? Even if it's a colour? If the room has no background layer, then the display buffer won't be cleared every step and so you get a "trail" effect much like the one that is shown in that image.
Yes, he has.
 

Yal

šŸ§ *penguin noises*
GMC Elder
Is the code actually in the Alarm 0 event and not in e.g. Step Event?
 
Top