Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I'm going through the pdf to try and add more  monsters and it says to add them into an array; which when I console.log it originally, it looks like It goes into an array but when I do this; the game breaks:  while I can move the game doesn't really do anything and I can't see the monster that  I added to the array

thoughts?



Hey, I think this is happening because you are pushing an array in there not the actual object.

Change this:

game.monsters.push([createBeing(makeMonster, freeCells)]);

To this:

game.monsters.push(createBeing(makeMonster, freeCells));

Removing the square brackets will just push the one monster into the monsters array.

Ahh thanks! That works; I was close lol. Your boilerplate is great I'm using it for Game Off 2021. Might continue to make more games with this once I become more familiar with rot.js

No problem, I’m glad it’s useful.