Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #the current spot of respawning the player which will change depending on the checkpoint
- currentRespawnPosition=player.position()
- #this varialbe will make sure that the stage is only created once during the gameplay
- isStage1=False
- isStage2=False
- def death():
- player.teleport(currentRespawnPosition)
- player.on_died(death)
- #building the stairs and the platform loading stage 1
- def newParkour():
- #teleporting the builder close to the player
- builder.teleport_to(pos(5, 0, 0))
- #rotate it
- builder.face(EAST)
- for i in range(70):
- #the builder places a stairs block
- builder.place(PURPUR_STAIRS)
- #the builder moves up and forward
- builder.shift(1, 1, 0)
- #marking the current position of the builder
- builder.mark()
- #moving the builder
- builder.shift(2, 0, -4)
- #the builder fills the space between its position and the mark with blocks
- builder.fill(DIAMOND_BLOCK)
- player.on_chat("start", newParkour)
- def stage1and2(builderRotation,courseType,checkpointType):
- #teleporting the builder under the platform and shifting it
- builder.teleport_to(pos(1, -4, 0))
- builder.mark()
- builder.face(EAST)
- for i in range(2):
- for j in range(5):
- #moving the builder
- builder.move(FORWARD, randint(3, 8))
- #creating a line of the certain block
- builder.line(courseType)
- #moving the builder to create a space between blocks
- builder.move(FORWARD, randint(2, 4))
- #marking the position so the next line is built starting from it
- builder.mark()
- #turning the builder
- builder.turn(builderRotation)
- #creating a new platform
- builder.mark()
- builder.shift(2, 0, -4)
- builder.fill(checkpointType)
- #the loop controlling loading stages and checkpoint system
- while True:
- if blocks.test_for_block(DIAMOND_BLOCK, pos(0, -1, 0)) and not isStage1:
- #updating player's position
- currentRespawnPosition = player.position()
- isStage1 = True
- stage1and2(RIGHT_TURN,SLIME_BLOCK,GOLD_BLOCK)
- elif blocks.test_for_block(GOLD_BLOCK, pos(0, -1, 0)) and not isStage2:
- currentRespawnPosition = player.position()
- isStage2 = True
- stage1and2(LEFT_TURN,MAGENTA_STAINED_GLASS_PANE,BEDROCK)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement