Huaraz
# Define and write the stairStep function here.
def stairStep() :
  mouse.moveRight(3)
  mouse.digDown()
hero.jumpRight()
hero.castEarthWave()
hero.moveUp()
stairStep()
hero.moveRight(1)
hero.moveUp(1)
t = hero.findNearestEnemy()
hero.castEarthPit(t)
stairStep()
hero.jumpRight()
stairStep()
hero.moveRight(1)
hero.jumpRight()
hero.moveRight(2)
stairStep()
functional crossing
def caterpillar(UDS, RS):
  hero.moveUp(UDS)
  hero.moveRight(RS)
  hero.moveDown(UDS)
  hero.moveRight(1)
caterpillar(1, 2)
caterpillar(2, 1)
caterpillar(3, 2)
mouse.moveRight(1)
mouse.digRight()
mouse.moveRight(1)
mouse.digRight()
mouse.bark()
mouse.moveUp(2)
hero.sneakUp(7)
function parts
L rivers
def crossRiver(heroSteps, mouseSteps):
  # Add function code here.
  hero.jumpRight()
  mouse.moveUp(mouseSteps)
  hero.moveUp(heroSteps)
  mouse.moveRight(2)
crossRiver(1, 2)
crossRiver(1, 1)
crossRiver(2, 3)
mouse.digRight()
hero.sneakUp(1)
hero.sneakRight(2)
hero.moveUp(1)
time to restore
I’m in your walls
def crossWall(HS,MS):
  mouse.digRight()
  mouse.moveDown(MS)
  hero.moveUp(HS)
  hero.moveRight(3)
  mouse.moveRight(1)
  # Add function code here.
crossWall(1, 1)
crossWall(2, 1)
crossWall(1, 4)
mouse.bark()
enemy = hero.findNearestEnemy()
hero.castTimeRestore(enemy)
mouse.moveDown(1)
hero.moveUp(3)
back to the good times
def pushAndRestore(steps):
  mouse.moveRight(steps)
  hero.moveRight(steps)
  mouse.bark()
  t = hero.findNearestEnemy()
  hero.castTimeRestore(t)
  # Add function code here.
pushAndRestore(2)
pushAndRestore(3)
pushAndRestore(1)
mouse.digUp()
mouse.moveUp(1)
hero.moveRight(1)
hero.moveUp(5)
hero.moveRight(1)
mouse.moveRight(2)
vault door
def pushAndRestore(RS, US):
  mouse.moveRight(RS)
  mouse.moveDown(US)
  hero.moveDown(US)
  hero.moveRight(RS)
  mouse.bark()
  enemy = hero.findNearestEnemy()
  hero.castTimeRestore(enemy)
pushAndRestore(2, 2)
pushAndRestore(1, 1)
pushAndRestore(2, 1)
hero.moveRight(2)
hero.jumpUp()
hero.jumpUp()
mouse.moveUp(1)
mouse.digUp()
mouse.moveRight(1)
mouse.moveUp(1)
hero.moveUp(3)
refoxion
octans = 'Octans'
def MV(us, rs):
  mouse.moveUp(us)
  mouse.moveRight(rs)
  hero.moveRight(rs)
  hero.moveUp(us)
  mouse.bark()
  hero.castTimeRestore(octans)
MV(2, 2)
MV(1, 3)
MV(1, 2)
hero.moveRight(1)
hero.sneakDown(2)
hero.castTimeRestore(octans)
object powers
Game time
Yum yum gems
Solo juega mamahuevazo
What’s the coordinate?
Coordinate methods
Rock catches leaf
Juega y ya we
Moth battle
Juega weon
Object spawning
Curiosity sandbox
avatar = game.spawnObject("moth")
avatar.setControl("wasd")
gem = game.spawnObject("gem-green", "random", "random")
enemy = game.spawnObject("spider")
enemy.setChaseTarget(gem)
enemy.setSpeed(0.5)
# Shows the directions of the game to the player.
game.addTextDirections("Use arrow keys to help the turtle eat the gems before the enemy
does!")
points = 0
# Defines a function that moves the gem to a random location.
def moveGem():
  gem.setX("random")
  gem.setY("random")
# GAME LOOP
# The while loop repeats rounds of the game until 60 seconds have passed.
# Each round updates displays and checks if objects have hit the gem.
while game.timePassed() < 60:
  game.advanceGame()
  game.setDisplay("TIME", game.timePassed())
  game.setDisplay("SCORE", points)
  if avatar.hit(gem):
    points += 1
    moveGem()
  if enemy.hit(gem):
    moveGem()
# GAME END
# After the loop ends, the conditional checks the point score.
# Depending on the number of points, the player sees a win or an end screen.
if points >= 10:
  game.win("You got " + points + " points! You Win!")
else:
  game.end("You got <20 points! Try Again.")
y gana pues weon