If you do console.log(Game.alienfort)
immediately after creating it, you will see the position printed. Note that the position is a string like “5x7” not an object like {x: 5, y: 7}
.
So in your code where you say makeMonster(Game.alienfort.x + "," + Game.alienfort.y)
you probably want to change it to this: makeMonster(Game.alienfort)
because the variable is already in the correct x,y
string format.
Hey do you want to send me your code and I’ll see if I can debug what is going on. Basically what I’ll do is sprinkle console.log statements throughout the code to check that each variable holds the values I’m expecting them to hold. For example I’ll put some log statements inside monsterAct
so I can check why the monster is hitting you but not getting drawn. I suspect it is to do with an undefined/null value somewhere, so I’ll be trying to track that down.
Hey sorry for the delay. I fixed your bug and moved the conversation to the “questions” section: https://itch.io/post/4901605