Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Pixelbox

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

Error: Cannot find module "pixelbox/pointer"... Um what?

A topic by lesbianham created Nov 01, 2020 Views: 176 Replies: 2
Viewing posts 1 to 3
(1 edit)

Been messing around with Pixelbox and exploring Cedric's GitHub for the past couple hours. I found the source for lightcast and thought it would be fun to play around with! Pixelbox asked me to update the code, which I've done. After doing so, trying to run results in the following error:


Error: Cannot find module "pixelbox/pointer"  from "C:/Users/user/Desktop/lightcast-master/src"


Should I not have updated the code? How can I fix this?

Thanks!

(1 edit)

Update:

Changing  "require('pixelbox/pointer')" to "require('pixelbox/pointerEvents')" in main.js lets me run the code without receiving on error, however the code still does not seem to work properly.  It seems that nothing is displayed on screen until collision is detected.

I'll continue to update if I make any more progress.

Update:

Figured it out! For some reason, I had "Use  webGL for rendering" checked in settings. Unchecking this fixed it! I'm a very amateur programmer, so I have absolutely no idea why, but webGL was conflicting with the function ctx.beginPath.

I hope anyone else messing around with lightcast can look at this and learn from it!