Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // function debugPos(x, y) {
- // explosion({ team: Teams.sharded, x: x, y: y, radius: 5, damage: 0, air: false, ground: false, pierce: false });
- // }
- function moveTo(x,y,tox,toy) {
- setBlock.block({ x: x, y: y, to: Blocks.air, team: Teams.sharded, rotation: 0 });
- setBlock.block({ x: tox, y: toy, to: sandBlock, team: Teams.sharded, rotation: 0 });
- }
- const sandBlock: BuildingSymbol = Blocks.surgeWall; // блок который воспринимается как песок
- const particles = fetch.buildCount(Teams.sharded, sandBlock);
- setRate(particles*3);
- print(particles);
- printFlush(getBuilding("message1"));
- const sand = fetch.build(Teams.sharded, Math.rand(particles), sandBlock);
- const blockBelow = getBlock.building(sand.x, sand.y - 1);
- if (blockBelow === undefined) {
- moveTo(sand.x, sand.y, sand.x, sand.y - 1);
- endScript();
- }
- const blockOnLeft = getBlock.building(sand.x - 1, sand.y - 1);
- const blockOnRight = getBlock.building(sand.x + 1, sand.y - 1);
- const wallLeft = getBlock.building(sand.x - 1, sand.y);
- const wallRight = getBlock.building(sand.x + 1, sand.y);
- if (blockOnLeft === undefined && wallLeft === undefined) {
- if (blockOnRight === undefined && wallRight === undefined && Math.rand(1)>0.5) {
- moveTo(sand.x, sand.y, sand.x + 1, sand.y - 1);
- endScript();
- }
- moveTo(sand.x, sand.y, sand.x - 1, sand.y - 1);
- endScript();
- }
- if (blockOnRight === undefined && wallRight === undefined) {
- moveTo(sand.x, sand.y, sand.x + 1, sand.y - 1);
- endScript();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement