Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- globalvar field;
- var chance, _x, _y, o, d, r, n, l;
- q_create(room_width, room_height, 1)
- // зоны
- // пещера
- bc[1, 1] = 1000
- bc[1, 2] = room_height
- bc[2, 1] = 1000
- bc[2, 2] = 3000
- bc[3, 1] = 3000
- bc[4, 1] = 4000
- // герой
- _x = room_width / 2
- _y = room_height / 2
- instance_create(_x, _y, player)
- drop(_x + 24, _y, 7, -1)
- drop(_x - 24, _y, 8, -1)
- o = instance_create(_x + 128 * choose(-1, 1), _y, tree)
- o.c = irandom_range(3, 6)
- o.sprite_index = execute_string("return spr_tree" + string(o.c))
- // пещера
- for(i = 0; i <= room_width; i += 1)
- {
- for(j = 0; j <= room_height; j += 1)
- {
- if irandom(30) == 1
- {
- repeat(irandom(208))
- {
- set_region(i, j, i + irandom_range(5, 25) * choose(-1, 1), j + irandom_range(4, 10), 0)
- }
- }
- if irandom(10) == 1
- {
- r = irandom(3)
- set_region(i - r, j - r, i + r, j + r, 0)
- }
- }
- }
- set_region(0, room_width div 32, 0, bc[1, 1] div 32, 0)
- repeat(irandom_range(10, 180))
- {
- _x = (irandom_range(128, room_width)) div 32
- _y = (irandom_range(128, room_height)) div 32
- set_region(_x, _y, _x + irandom_range(1, 20) * choose(-1, 1), _y + irandom_range(1, 20) * choose(-1, 1))
- }
- // лианы
- for(i = 0; i < room_width div 32; i += 1)
- {
- for(j = 0; j < room_height div 32; j += 1)
- {
- if field[i, j] == 1 or field[i, j] == 2
- {
- if irandom(10) == 1
- {
- if j < (room_height div 32) - 1
- {
- if !block_solid[field[i, j + 1]]
- {
- instance_create(i * 32, j * 32 + 16, liana)
- n = irandom_range(5, 10)
- for(l = 1; l < n + 1; l += 1)
- {
- instance_create(i * 32, j * 32 + 16 + irandom_range(4, 7) + l * 2, liana)
- }
- }
- }
- }
- }
- }
- }
- // деревья
- repeat(irandom_range(20, 70))
- {
- instance_create(random(room_width), random(room_height), tree)
- }
- // шипы
- repeat(irandom_range(20, 60))
- {
- instance_create(random(room_width), random(room_height), spike)
- }
- //магазин
- //instance_create(random_range(64, room_width - 64), random_range(64, room_height - 64), shopguy)
- instance_create(spawn[1] + random_range(64, 512) * choose(-1, 1), spawn[2] + random_range(64, 512) * choose(-1, 1), shopguy)
- // чёрные ящики
- repeat(10)
- {
- instance_create(random(room_width), random(room_height), blackbox)
- }
- // coinbox
- instance_create(random(room_width), random(room_height), coinbox)
Add Comment
Please, Sign In to add comment