[Adventurer] Time To Live


The level Time to Live is available for testing.

This level takes place in the Game Dev 1 campaign, and introduces using an argument with addSurviveGoal.



I’m trying to complete the level, but the generator is only spawning skeletons.
Can you take a look at my code?


# Pass an argument to addSurviveGoal() to specify a time.

# This means the player must survive for 20 seconds.

# Spawn a generator with spawnXY
# Remember to assign the spawned generator to a variable!
# Use the variable to configure the generator below.
generator = game.spawnXY("generator", 36, 30)
# Set the generator's spawnType to "munchkin"
generator.spawntype = "munchkin"
# Use spawnHeroXY to spawn a hero for the player.
# Remember to assign the spawned hero to a variable!
knight = game.spawnHeroXY("knight", 10, 40)
# Set the hero's maxHealth to 100
knight.maxHealth = 100
# Set the hero's attackDamage to 10
knight.attackDamage = 4.32

# Play the game!


Try this:



It’s working now.

Thank you!


I’ve got this exact code typed in (*even copies and pasted) and I continue to get the “Incomplete” message of “Set Up Players Hero”.



I’ve got the same problem. Anyone got a solution to this?


The code posted above is incomplete. Read the comments and it tells you what to do. If the hero set up is incomplete, then complete it according to the comments.


The problem many people run into on this level is that you need to type the property names exactly as they are in the comments, including capitalization.

maxhealth is not the same as maxHealth, for example.


I’ve got the “Set Up Players Hero” problem as well. Has anyone had any luck with solving this problem?


thanks a lot :grinning::grinning: