"Crushing it" Level Help


#1

My son is having trouble with the level “Crushing It”

His code:

# Spawn a hero using game.spawnPlayerXY(type, x, y).
player = game.spawnPlayerXY("captain", 36, 30)
game.addSurviveGoal()
# Add a goal to defeat ogres with game.addDefeatGoal()
game.addDefeatGoal(4)


game.spawnXY("munchkin", 40, 10)
# Spawn at least 3 more munchkins.
mySpawn = game.spawnXY("munchkin", 35, 30)
mySpawn = game.spawnXY("munchkin", 38, 30)
mySpawn = game.spawnXY("munchkin", 36, 32)

I am usually able to help him, but I am missing something.

Thanks.


#2

you don’t need to add mySpawn for the munchkins 3 times. You just need
game.spawnXY("unit or item in here", "the x position of the unit or item here", "the y position of the unit or item here").
Example:

game.spawnXY("ogre", 42, 36)

that will spawn an ogre in the position 42, 36


#3

That’s not the problem.

For the Defeat Goal, there isn’t supposed to be an input. Remove the “4” for the defeat goal and you will be all set.