Problem with level 12 Forest incursion


#1

I can’t complete this level, although I do what it says. But the level is “incomplete” because I don’t increase hero’s max health.

# Okar needs to stomp out these annoying little munchkins!
# Unfortunately he is slow, and his attacks do little damage.
# Fortunately, as a game developer, you have full control over the world!
# Set Okar's properties to buff him up for ogre slaying!

game.addDefeatGoal()
game.addSurviveGoal()
hero = game.spawnHeroXY("goliath", 12, 10)
# Increase the hero's maxSpeed, so he runs faster.
hero.maxSpeed = 25
# Increase the hero's maxHealth, so he lasts longer.
hero.maxHealth = 300
hero.health = 300
# Increase the hero's attackDamage, so he can quickly take down the ogres.
hero.attackDamage = 1000

#2

So why don’t you increase maxHealth? Your code indicates that it is still the same as when the level starts. You have not done this.


#3

I did, I set it to 300. What am I missing?

By the way, the language is Python.


#4

This is Goliath’s stats at the beginning of the level, before any code is written.

You didn’t increase his health, you lowered it.


#5

I didn’t see that. :joy::joy::joy::joy: Thank you! :grin:


#6

while you’re doing that, change maxSpeed to a very high speed under 500, since over that is basically teleporting