sinigrimi
Member
Sorry to bother you again, but GML torments me. This time, the script does not always work for me, which should always work if I understand the mechanics correctly.
I specifically shot a video (it is below), code is bellow too. Short description, when I go into the room, "Room" = false" is activated
when the room is false, the "enemy" event is generated, and in the controller if the "enemy" = "BeeRoom" event is used, the BeeRoom () script is used. In practice, it always works for me that it says "enemy" = "BeeRoom", but the script itself does not always work. Help me please. And I'm sorry that a lot of questions, I'm new to this gml topic.
I specifically shot a video (it is below), code is bellow too. Short description, when I go into the room, "Room" = false" is activated
when the room is false, the "enemy" event is generated, and in the controller if the "enemy" = "BeeRoom" event is used, the BeeRoom () script is used. In practice, it always works for me that it says "enemy" = "BeeRoom", but the script itself does not always work. Help me please. And I'm sorry that a lot of questions, I'm new to this gml topic.
Code:
if map[? "start"] == false
{
randomize();
var Lvl1 = choose("BeeRoom")//, "RatRoom", "SpiderRoom","RandomRoomOne","RandomRoomTwo","RandomRoomThree");
map[? "enemy"] ="BeeRoom"// Lvl1;
show_debug_message(string_letters(Lvl1));
Code:
var _type = string_letters(map[? "enemy"]);
// var _xx = 160 + random(room_width - 320);
//var _yy = 160 + random(room_height - 320);
switch(_type)
{
case "BeeRoom":
BeeRoom();
break;
Code:
randomize();
var x1 = 160 + random(room_width - 320);
var y1 = 160 + random(room_height - 320);
var x2 = 160 + random(room_width - 320);
var y2 = 160 + random(room_height - 320);
var x3 = 160 + random(room_width - 320);
var y3 = 160 + random(room_height - 320);
var x4 = 160 + random(room_width - 320);
var y4 = 160 + random(room_height - 320);
var x5 = 160 + random(room_width - 320);
var y5 = 160 + random(room_height - 320);
if irandom(10) == 0{
instance_create_layer(x1, y1, "Instances", oBee)
instance_create_layer(x2, y2, "Instances", oBee)
instance_create_layer(x3, y3, "Instances", oBee)
instance_create_layer(x4, y4, "Instances", oBee)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("0")
}
else if irandom (10) == 1{
instance_create_layer(x1, y1, "Instances", oBee)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x3, y3, "Instances", oBeeMale)
instance_create_layer(x4, y4, "Instances", oBee)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("1")
}
else if irandom (10) == 2{
instance_create_layer(x1, y1, "Instances", oBeeMale)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x3, y3, "Instances", oBeeMale)
instance_create_layer(x4, y4, "Instances", oBee)
show_message("2")
}
else if irandom (10) == 3{
instance_create_layer(x1, y1, "Instances", oBeeHive)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x4, y4, "Instances", oBee)
show_message("3")
}
else if irandom (10) == 4{
instance_create_layer(x1, y1, "Instances", oBee)
instance_create_layer(x2, y2, "Instances", oBeeHive)
instance_create_layer(x4, y4, "Instances", oBee)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("4")
}
else if irandom (10) == 5{
instance_create_layer(x1, y1, "Instances", oBeeMale)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x3, y3, "Instances", oBeeMale)
instance_create_layer(x4, y4, "Instances", oBeeMale)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("5")
}
else if irandom (10) == 6{
instance_create_layer(x1, y1, "Instances", oBeeHive)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x3, y3, "Instances", oBeeMale)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("6")
}
else if irandom (10) == 7{
instance_create_layer(x1, y1, "Instances", oBeeHive)
instance_create_layer(x4, y4, "Instances", oBeeHive)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("7")
}
else if irandom (10) == 8{
instance_create_layer(x1, y1, "Instances", oBeeHive)
instance_create_layer(x2, y2, "Instances", oBee)
instance_create_layer(x3, y3, "Instances", oBee)
instance_create_layer(x4, y4, "Instances", oBee)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("8")
}
else if irandom (10) == 9{
instance_create_layer(x1, y1, "Instances", oBeeHive)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x3, y3, "Instances", oBeeMale)
show_message("9")
}
else if irandom (10) == 10{
instance_create_layer(x1, y1, "Instances", oBee)
instance_create_layer(x2, y2, "Instances", oBeeMale)
instance_create_layer(x3, y3, "Instances", oBee)
instance_create_layer(x4, y4, "Instances", oBee)
instance_create_layer(x5, y5, "Instances", oBee)
show_message("10")
}