Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Game Developement 1, Level 14, Character not Moving

Game Development 1, Level 14
In this level, the character is not moving when I click it to a certain position. For all of the other levels, this worked fine.
I believe this is not a problem with my code, but here it is.

player = game.spawnXY("champion", 15, 35)
player.attackDamage = 190
player.maxSpeed = 10
player.health = 2000
game.addSurviveGoal()
game.addDefeatGoal()
game.spawnXY("x-mark-stone", 60, 35)
generator = game.spawnXY("generator", 39, 55)
game.spawnXY("lightstone", 24, 36)

I cannot attack either. HELP!

Hi @wyattbaek, welcome to the forum.
It took me a while to find it, but here’s the line causing the error:

What are you spawning? Is there are special spawn method for that type of thing?
Danny

@Deadpool198 No, when I try it with all of the other characters, it seems to not work either.

That’s not what I was suggesting. Theres a method called game.spawnHeroXY(), which is different to game.spawnXY().
Danny

@Deadpool198 Thank you so much! It finally worked! I was stuck on this level for days.