Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

"Crushing it" Level Help


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)
# Add a goal to defeat ogres with game.addDefeatGoal()

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.



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").

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

that will spawn an ogre in the position 42, 36


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.