L
LanderMiskolczi
Guest
So My game freezes, Idk if my game is stuck in a loop or something else, Can I have help?
It only freezes when enemyCount is equal to 7
OB_SPAWNER
Create
Alarm[0] (Only has a comment)
Step
Draw
I think this is the problem but I have no idea, There is another do loop in my game, but I dont think thats the problem if you want to see it tho, here it is
SCRIPT I MADE
It only freezes when enemyCount is equal to 7
OB_SPAWNER
Create
Code:
/// Varabiles
enemyCount = 0;
ranX = 2;
ranY = 2;
Step
Code:
/// Spawn Enemys
if (enemyCount <= 25)
{
if (alarm[0] <= 0)
{
do
{
ranX = irandom_range(0, room_width);
ranY = irandom_range(0, room_height);
}
until (!collision_point(ranX, ranY, ob_wall, true, true))
instance_create(ranX, ranY, ob_enemy);
enemyCount++;
alarm[0] = room_speed*2;
}
}
Code:
/// Draw enemyCount
draw_text(room_width-98, 16, 'Enemys: ' + string(enemyCount));
draw_text(room_width-226, 32, 'RANX/RANY: ' + string(ranX) + '/' + string(ranY));
SCRIPT I MADE
Code:
/// sc_choose_movement_type
alarm[1] = room_speed;
dir = choose(0, 1);
do
{
randomX = irandom_range(0, room_width);
randomY = irandom_range(0, room_height);
} until (!collision_line(x, y, randomX, randomY, ob_wall, true, true))
enemyType = enemyMovement[irandom_range(0, 3)];