GameMaker: Studio

GameMaker: Studio

Find, play, and make games easily
Discover, rate, and download the best player-created games made in GameMaker: Studio for free. Or try making your own and share with the community. Click here to learn more.
L4undry 4 26 Aug, 2014 @ 5:14am
Creating infinie terrain on the y axis.
So, you probably have all seen my game CubeExplorers, (It's number 1 on the workshop...)
I was wondering if any of you could analyse my cocde and tell me how I could make the stone go some 60 more blocks down. Here is my code:

var sh = (room_height / 2) - floor(random(room_height / 3));
sh = (sh / 32) * 32;

var starting_room = argument0;
var ending_room = argument0 + 1600;

var ah = sh;

var dirt_level;
var stone_level;
var l;

for(xx = starting_room; xx < ending_room; xx += 32) {
z = floor(random(20));
if(z == 0) {
with(instance_create(xx, ah - 32, obj_tree)) {
canGrow = true
}
}
instance_create(xx, ah, obj_grass);
dirt_level = ((room_height - ah) / 32) * 32;
stone_level = ((room_height) / 32) * 32;

for(yy = ah; yy < dirt_level; yy += 32) {
instance_create(xx, yy+32, obj_dirt);
l = yy;
}
for(yy = l; yy < stone_level; yy += 32) {
if(yy >= ah) {
instance_create(xx, yy + 32, obj_stone);
} else {
instance_create(xx,yy,obj_water);
}

}
ah += choose(32, -32, 0);
}

return ending_room;



Ps. I dont use Drag and Drop.....