• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Converting to gm2

L

Logan Bevans

Guest
Hey iv just recently got gm2 and I'm trying to convert some of my scripts into it and im having a bit of an issue with one of them

i can't get it to generate blocks i believe its something to do with the xx for loop


[var sh,ah,dirt_level,stone_level,water_level,adl,starting_room,ending_room, tree, biome,hill;
sh = 1920;
randomize();
//Starting Height
ah = sh;

tree = choose(1);
biome =1; //choose(1,2,3,4);
hill = choose(true,false,false);
cacti = 0;

for(xx = 0; xx < room_width; xx += 32) {

if biome = 1{

//Biomes
//------PLAINS------//
instance_create_depth(xx,ah,10,obj_grass);
dirt_level = ah + 32*choose(2,3,3,3);
stone_level = 4192; //room_height poss inf down
water_level = 1920;

//Dirt Level
for(yy = ah; yy < dirt_level; yy += 32){
instance_create_depth(xx, yy + 32,10,obj_dirt);
adl = yy
}
//Stone Level
for(yy = adl; yy < adl + 64; yy += 32){
u = round(random(choose(3)));
if u = 1{
instance_create_depth(xx, yy + 64,10,obj_stone);
}else {
instance_create_depth(xx, yy + 64,10, obj_dirt);
}
}
for(yy = adl + 64; yy < stone_level; yy += 32){
instance_create_depth(xx, yy + 64,10, obj_stone);
}
//Height Variation In Biome
if (hill){
amp = 7;
} else {
amp = 5 + random(4);
}
ah += amp*sin((2*pi)/1728*(xx-864))+((8+random(8))*sin((2*pi)/choose(54,108,240)*xx))+((15+random(2))*sin((2*pi/240)*xx));
}
}]
 
Top