[Adventurer] Time To Live


#1

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.


#2

Hello,

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

Thanks!

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


# This means the player must survive for 20 seconds.
game.addSurviveGoal(20)

# 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!


#3

Try this:

generator.spawnType='munchkin'

#4

It’s working now.

Thank you!


#5

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”.

HELP…


#6

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


#7

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.


#8

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.


#9

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


#10

thanks a lot :grinning::grinning: