Areas

Area:

1: Desert and Sewers

3: Scrapyard and Crystal Caves

5: Frozen City and Labs





1: Desert and Sewers 3: Scrapyard and Crystal Caves 5: Frozen City and Labs Subarea:

0 to 2: Normal levels

3: Transition levels

if area < 7

if area = 1 { if random(2) < 1 {instance_create(x,y,Floor) instance_create(x+32,y,Floor) instance_create(x+32,y+32,Floor) instance_create(x,y+32,Floor) }else instance_create(x,y,Floor)}

// EXAMPLE if area = 7 { if random(20) < 1 // random chance of generating an area that looks like an upside-down cross (I was thinking of Spelunky's Hell level when creating this, DON'T JUDGE ME) {instance_create(x,y,Floor) instance_create(x,y-32,Floor) instance_create(x,y-64,Floor) instance_create(x,y+32,Floor) instance_create(x-32,y,Floor) instance_create(x+32,y,Floor) }else instance_create(x,y,Floor)} // if the random chance fails, then just create a single floor tile

if area = 3 trn = choose(0,0,0,0,90,-90)

trn = choose(0,0,0,90,-90,180)

// EXAMPLE if area = 7 trn = choose(0,0,0,0,0,0,0,0,90) // this will never turn right

if Player.area = 6 tip = choose("beep boop","nerds","don't push any buttons")

if Player.area = 7 tip = choose("hell","getting hot","the floor is lava")

if Player.area = 6 background_color = make_color_rgb(9,28,32)

if Player.area = 6 background_color = make_color_rgb(127,39,39)

if Player.area = 6 spawnarea = 6

if Player.area = 7 spawnarea = 7

//DESERT if spawnarea = 1 or spawnarea = 0// or spawnarea = 100 { if styleb = 1 { instance_create(x+16,y+16,choose(MaggotSpawn,BigMaggot,BigMaggot,Maggot)) } else { if random(7) < 1 instance_create(x+16,y+16,choose(MaggotSpawn,Scorpion)) else {if random(30) < 1 {instance_create(x+16,y+16,Barrel) instance_create(x+16+random(4)-2,y+16+random(4)-2,Bandit) instance_create(x+16+random(4)-2,y+16+random(4)-2,Bandit) instance_create(x+16+random(4)-2,y+16+random(4)-2,Bandit)} else instance_create(x+16,y+16,choose(Bandit,Bandit,Bandit,Bandit,Bandit,Bandit,Maggot,Scorpion))} } }

//HELL if spawnarea = 7 { if styleb = 1 // if the ground has the sprFloorIDB sprite { instance_create(x+16,y+16,choose(Sniper,Sniper,GatorSmoke,GatorSmoke,Torch)) } else { if random(5) < 1 instance_create(x+16,y+16,choose(Ratking,SuperFrog,Car,SnowBot,Molesarge)) else {if random(30) < 1 {instance_create(x+16,y+16,ToxicBarrel) instance_create(x+16+random(4)-2,y+16+random(4)-2,Molefish) instance_create(x+16+random(4)-2,y+16+random(4)-2,Molefish) instance_create(x+16+random(4)-2,y+16+random(4)-2,SuperFireBaller)} else instance_create(x+16,y+16,choose(Molefish,Molefish,Molefish,Molefish,Molefish,SnowBot,Car))} } }

if area = 1 { if random(19+instance_number(FloorMaker)) > 20 { instance_destroy() if point_distance(x,y,10016,10016) > 48{ instance_create(x+16,y+16,AmmoChest) instance_create(x,y,Floor)} } if random(8) < 1 instance_create(x,y,FloorMaker) }

// EXAMPLE if area = 7 { if random(19+instance_number(FloorMaker)) > 20 { instance_destroy() if point_distance(x,y,10016,10016) > 48{ instance_create(x+16,y+16,AmmoChest) instance_create(x,y,Floor)} } if random(8) < 1 instance_create(x,y,FloorMaker) }

if area = 0 { song = sound_add("themeA.wav",0,0) amb = sound_add("ambient0.wav",0,0) }

// EXAMPLE if area = 7 { song = sound_add("boss2.wav",0,0) amb = sound_add("ambient3.wav",0,0) }

What I'll be creating:Here's a reference you should keep in mind if you're using portals to test your new areas:Objects > Player > Room End: Add 1 to LINE 20.Create the following sprites:(names DO matter // ID is the area)sprFloorID - floorsprWallIDBot - bottom wallsprWallIDTop - top wallsprFloorIDB - special floor (mud on Desert, ice on Frozen City, cobwebs on Crystal Caves...)sprFloorIDExplo - remains of a blown-up wallsprWallIDOut - bits that stick out of the walls, makes them look less flatsprWallIDTrans - transition from wall to backgroundsprDebrisID - what flies off of walls when they're blown upScripts > scrMakeFloor: Copy the code from LINE 9 to LINE 14......and paste it at the bottom of the script. Change the values to how you want your area to generate.Still in the scrMakeFloor script, copy LINE 113 and LINE 114......and paste it under LINE 124.Change it to how often you want the level generator to turn. 0 is no change, 90 or -90 are left and right respectively, and 180 is a half-360. :)Scripts > scrTips: copy the code from LINE 63 to LINE 64......and paste it under LINE 64.Change its contents, along with the area number, to tips that the players can see when entering the level.Objects > GenCont > Create Event: copy the code from LINE 22 to LINE 23......and paste it under LINE 23.Change the RGB value to what you want the background to be. Usually this color matches the color of the transition sprites.Scripts > scrPopulate: copy LINE 11...and paste it under that line.Change both numbers to your area.Scripts > scrPopEnemies: copy the code from LINE 1 to LINE 21...and paste it at the bottom of the script.Change its contents to spawn whatever enemies you want, either pre-existing or custom-made.Scripts > scrMakeFloor: copy the code from LINE 162 to LINE 173...and paste it at the bottom of the script.Change its values to how often you want the level generator to spawn a duplicate of itself to speed up the level generation and make things less linear.Objects > MusCont > Room Start: copy the code from LINE 26 to LINE 30......and paste it under that line.Change the area number to your area's, and change themeA and ambient0 to your area's music. It can be any .WAV file inside the Nuclear Throne folder, or anywhere inside its hierarchy.