Placeholder

Will Change Later

May 27, 2021 - General Update

Working on two games at the same time is a terrible idea. The way i go around it is, whenever i get stuck on one of the two projects i try to renember or write down what i wanted to do at the time, or fixes that i have to do, last time i worked on Dungeon Of Bizarre i wrote down a few bugs Screenshot At round 12 (on the third boss) you literally couldn’t continue playing the game, you get stuck because of the way spawning enemies work and one of the main mechanics of the boss

// Spawn 1
if (r_01 < 40){
	b_01 = obj_enemy_1;
}
else if (r_01 >40 && r_01 < 50)
{
	b_01 = obj_big_enemy_3;
}
else if (r_01 > 50 && r_01 < 70)
{
	b_01 = obj_enemy_2;
}
else if (r_01 > 70 && r_01 < 80)
{
	b_01 = obj_enemy_3;
}
else if (r_01 > 80 && r_01 < 90)
{
	b_01 = obj_enemy_4;
}
else if (r_01 > 90)
{
	b_01 = obj_enemy_5;
}

// Spawn 2
if (r_02 < 40)
{
	b_02 = obj_enemy_1;
}
else if (r_02 >40 && r_02 < 50)
{
	b_02 = obj_big_enemy_3;
}
else if (r_02 > 50 && r_02 < 70)
{
	b_02 = obj_enemy_2;
}
else if (r_02 > 70 && r_02 < 80)
{
	b_02 = obj_enemy_3;
}
else if (r_02 > 80 && r_02 < 90)
{
	b_02 = obj_enemy_4;
}
else if (r_02 > 90)
{
	b_02 = obj_enemy_5;
}

// ELSE IF
// ELSE IF
// ELSEIFELSEIFELSEIF

This is a bit embarrassing, basically what’s happening is that a random value in the range of “(0, 100)” is given to “r_01”, “r_02”, “r_03” and “r_04”, depending on the value its gonna decide which enemy to spawn, and that happends every random amount of seconds.

This is not the most efficient way of doing this, but you gotta understand, MOST of the code its like this, im aware that it could be 100x times better, i started this project a few years ago, when i was around 15 and dropped it some time later, then got back into it like two or three years later (a few months ago, now im 18), and theres A LOT to fix in here

if (place_free(spawnX, spawnY))
{
	instance_create(-64, random_range(0, room_height+64), b_01);
	instance_create(room_width+64, random_range(0, room_height+64), b_02);
	instance_create(random_range(0, room_width+64),-64, b_03);
	instance_create(random_range(0, room_width+64),room_height+64, b_04);

	alarm[1] = info.spawn_time;

	// ENEMY TYPE
	r_01 = irandom_range(0,100);
	r_02 = irandom_range(0,100);
	r_03 = irandom_range(0,100);
	r_04 = irandom_range(0,100);

	//a_01 = 1;
}

Once its checked that it can spawn an enemy (if the current wave is just starting and the monsters wont spawn inside a wall or the player, etc) it will spawn them in a random place in the map

“info” is a persistent object that stores the amount of monsters killed per wave, the damage of weapons and the enemies and in this case, the time it takes to spawn an enemy

“info” also saves the amount of enemies killed per round and its used by the object that contains the code for spawning enemies (literrally called “i_spawn”), this later checks if the amount of enemies killed its not the same or bigger than the amount spawned, so when there’s a boss that spawn’s an enemy that its normally handled by “i_spawn”, “i_spawn” stops spawning monsters because it thinks that the round is over, but “info” does not recibe this information, and for that reason, the game locks itself and you cant get to the next round