Windows Problem with enemy spawn

Prandini

Member
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:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
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
Moderator
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.
 

Prandini

Member
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