began integrating some of the loops i learned into gml(game maker language). started working on a random terrain generator.
/// create event
// Initializing variables
cposx = 1;
cposy = 1;
// Creating
step event |
/// world generation
if genstage = 0 {// creates a worldwide ocean
while (cposx < room_width && cposy < room_height) {
instance_create_depth(cposx,cposy,0,obj_ocean);
cposx += 1;
if (cposx == room_width && cposy != room_height) {
cposy += 1;
cposx = 1;
}
else {
genstage = 1;
}
}
}
/// create event
// Initializing variables
cposx = 1;
cposy = 1;
// Creating
step event |
/// world generation
if genstage = 0 {// creates a worldwide ocean
while (cposx < room_width && cposy < room_height) {
instance_create_depth(cposx,cposy,0,obj_ocean);
cposx += 1;
if (cposx == room_width && cposy != room_height) {
cposy += 1;
cposx = 1;
}
else {
genstage = 1;
}
}
}
Comments
Post a Comment