cutting woods out of the world (locked)

Subscribe to cutting woods out of the world 1 post

avatar for ErlendHL ErlendHL 1313 posts
Flag Post

Encapsulate your code in pre tags, like this

my code+ - _ #ยค%&/(

As for the problem,
the line heroY; doesn’t do anything.

I recommend you not to use the built in hitTest.
Also it seems you’re first checking if the hero touches a tree from the model:

else if (gameMap[heroY + 1][heroX] == 4)

And then you remove any wood displayobjects it touches. You should either have all the logic in the model (checking for collision and removing wood in the gameMap, and draw everything every from the model, or you could have the logic be in the displayObjects (the wood and movieclips)