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

Problem with level 12 Forest incursion


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!

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 = 300
# Increase the hero's attackDamage, so he can quickly take down the ogres.
hero.attackDamage = 1000


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.


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

By the way, the language is Python.


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.


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


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