Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Pixelbox

Create 2D games in JavaScript, made easier · By Cedric Stoquer

Update only runs 2 times?

A topic by Tomis created May 10, 2020 Views: 197 Replies: 2
Viewing posts 1 to 3


I been following the official begginer guide to create a game, and it said to type this in to the main.js update function:

exports.update = function () {  

   sprite(random(255), random(120), random(120)); 

};

and it should be creating tons of random sprites, but instead it only runs 2 times and stops, creating 2 sprites only.

Please help.

That is definitely not a normal behavior.

Do you see any errors is the debug console? (open the console from Debug > Devtool)

I managed to fix it by deleting the old project and creating  new one, I do remember seeing an error in the console though.