Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #castle creating function
- #the minimum length of the walls is 20. if the walls are shorter the stairs won't be generated correctly
- #the length of the walls has to be EVEN or the corners won't be generated correctly
- #the recommended wall height is 4. Only then the creepers can get activated and explode
- def castleBuilder(wallLength, wallHeight):
- wallLengthCopy = wallLength / 2
- builder.teleport_to(pos(-5, 0, 5))
- builder.set_origin()
- builder.mark()
- i = 0
- #the loop creating 3 layer wall around the player
- while i < 3:
- j = 0
- while j < 4:
- builder.move(FORWARD, wallLength)
- builder.raise_wall(MOSSY_STONE_BRICKS, wallHeight)
- builder.turn(RIGHT_TURN)
- j += 1
- wallLength += -2
- builder.move(RIGHT, 1)
- builder.move(FORWARD, 1)
- builder.mark()
- i += 1
- builder.move(UP, wallHeight - 1)
- builder.face(WEST)
- builder.move(BACK, 15)
- builder.mark()
- i = 0
- #the loop creating stairs
- while i < wallHeight - 1:
- builder.shift(1, -1, 0)
- builder.line(STONE_BRICK_STAIRS)
- i += 1
- builder.teleport_to_origin()
- builder.move(UP, wallHeight)
- builder.face(NORTH)
- builder.mark()
- i = 0
- #the loop creating corners
- while i < 4:
- j = 0
- while j < wallLengthCopy:
- builder.place(SEA_LANTERN)
- builder.move(FORWARD, 2)
- j += 1
- builder.turn(RIGHT_TURN)
- i += 1
- player.on_chat("castle", castleBuilder)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement