Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _currentXSection = argument0;
- var _currentYSection = argument1;
- var _sectionStringData = argument2;
- var subString = "";
- var p = 1;
- for (c = 1; c < string_length(_sectionStringData) + 1; c++)
- {
- if (c mod 2 = 0)
- {
- p++
- subString = string_char_at(_sectionStringData, c-1) + string_char_at(_sectionStringData, c)
- switch(subString)
- {
- case "00":
- break;
- case "":
- break;
- case "01":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objWall)
- break;
- case "02":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objBaddie1)
- break;
- case "03":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objPlayerSpawn)
- break;
- case "04":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objFence)
- break;
- case "05":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objRock)
- break;
- case "06":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+(floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor1)
- break;
- case "07":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+(floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor2)
- break;
- case "08":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor3)
- break;
- case "09":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor4)
- break;
- case "10":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor5)
- break;
- case "11":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor6)
- break;
- case "12":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor7)
- break;
- case "13":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor8)
- break;
- case "14":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objDecor9)
- break;
- case "15":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "Walls",objGoldenFence)
- break;
- case "16":
- instance_create_layer((_currentXSection * sectionWidth) + (((p-1) mod sectionTilesX) * gridSize) +gridSize,
- (_currentYSection * sectionHeight)+ (floor((p-1)/sectionTilesX)* gridSize) +gridSize,
- "DivinePasture",objDivinePasture)
- break;
- }
- }
- else
- {
- subString = ""
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement