Game Dev 2 final project glitch

so it goes from this!


to this

It just keeps going and going. I never even put the ogre-f there in the firs place. All this happens while I click were the hero should go and it just move from right to left without me touching my mouse.

What is your code?

I kept it simple here it is

# Create your own game!

# Spawn a hero with spawnHeroXY()
game.spawnPlayerXY("guardian", 10, 10)
# Add at least one goal!
game.addSurviveGoal()
game.addCollectGoal()
game.spawnMaze("forest", 60)
game.spawnXY("chest", 36, 29)
game.spawnXY("chest", 15, 59)
# Spawn objects into the game with spawnXY()
tra = game.spawnXY("fire-spewer", 40, 10)
trap = game.spawnXY("fire-spewer", 34, 45)
trap.direction = "horizontal"
tra.direction = "vertical"```