S
Shahil
Guest
Room Creation Code::
var i, file;
file = file_text_open_read("level_1.lvl");
i = 0 ;
while (!file_text_eof(file)) {
object = file_text_read_string(file); // object name
file_text_readln(file);
object_x = file_text_read_real(file); // object x
file_text_readln(file);
object_y = file_text_read_real(file); // object y
file_text_readln(file);
if(instance_exists(object)) {
instance_create(real(object_x),real(object_y),object);
} else {
show_message("Name: " + object + " X: " + string(object_x) + " Y: " + string(object_y))
}
i = i + 3;
}
file_text_close(file);
Level 1 File:
obj_goomba
128
48
obj_maskman
384
64
The object is not creating in the room...
if i write the code instance_create(90,90,obj_goomba) it create but when i try to do from the above file it does not create the object
var i, file;
file = file_text_open_read("level_1.lvl");
i = 0 ;
while (!file_text_eof(file)) {
object = file_text_read_string(file); // object name
file_text_readln(file);
object_x = file_text_read_real(file); // object x
file_text_readln(file);
object_y = file_text_read_real(file); // object y
file_text_readln(file);
if(instance_exists(object)) {
instance_create(real(object_x),real(object_y),object);
} else {
show_message("Name: " + object + " X: " + string(object_x) + " Y: " + string(object_y))
}
i = i + 3;
}
file_text_close(file);
Level 1 File:
obj_goomba
128
48
obj_maskman
384
64
The object is not creating in the room...
if i write the code instance_create(90,90,obj_goomba) it create but when i try to do from the above file it does not create the object