sinigrimi
Member
The first part is more or less solved, here is the second:
My rooms are randomly generated. I think that this can be written in ds_list as it is done here:
but I have very, very many lines with creating objects. how can I effectively add them to ds_list. or maybe there are other options?
I have a script in which there is the following:
in the controller the following:
in the scripts are switch systems in which everything is indicated in a similar way:
I also attach a video in which you can see that the spawn of objects changes:
Addition: I do not aspire to do as indicated in the first spoiler, I need to spawn my objects at certain coordinates (in the fourth spoiler) but not be updated every time I return to the room
My rooms are randomly generated. I think that this can be written in ds_list as it is done here:
Code:
map[? "chests"] = 1 + irandom(4);
map[? "chest_list"] = ds_list_create();
for (var a = 0; a < map[? "chests"]; a++;)
{
var _x = 96 + random(room_width - 160);
var _y = 96 + random(room_height - 160);
ds_list_add(map[? "chest_list"], _x, _y);
}
show_debug_message("CHESTS ADDED");
}
I have a script in which there is the following:
Code:
if map[? "start"] == false
{
var Lvl1 =choose("BeeRoom")//, "RatRoom", "SpiderRoom");//,"RandomRoomOne","RandomRoomTwo","RandomRoomThree");
map[? "enemy"] =Lvl1;
show_debug_message(string_letters(Lvl1));
map[?"fixed"] = Lvl1;
map[?"fixed_list"] = ds_list_create();
in the controller the following:
Code:
var room_type = irandom_range(0,9);
case"fixed":
// if (up == true) and (bottom == false) and (left ==false) and (right ==false){
var _type = string_letters(map[? "fixed"]);
switch(_type){
case "BeeRoom":
fixed_BeeRoom(room_type);
}
//}
break;
case "enemy":
// if (up == true) and (bottom == false) and (left ==false) and (right ==false){
var _type = string_letters(map[? "enemy"]);
switch(_type)
{
case "BeeRoom":
BeeRoom(room_type);
break;
Code:
case 7:
spawn(1020,420,oStone);
spawn(900,540,oStone);
spawn(1140,540,oStone);
spawn(1020,660,oStone);
break;
Addition: I do not aspire to do as indicated in the first spoiler, I need to spawn my objects at certain coordinates (in the fourth spoiler) but not be updated every time I return to the room
The first part is more or less solved, here is the second:
https://forum.yoyogames.com/index.p...questions-im-really-a-noob.71724/#post-423570
Last edited: