Online Sourcerer

Making a library based game engine

Posted by: altug

I am currently making a library that lets you add basic obstacles rooms and players to the scene all based on the web. The only issue im facing is collision boxes and their paddings.

Source:

Score: 3

Category: game

Added: 2025-12-12 11:26:21

tracehunter

Consider using an existing physics library like matter.js as a reference. Collision detection is deceptively complex.

daniwild

The padding issue might be related to CSS box-sizing. Are you accounting for border-box vs content-box?

randomator

For collision detection, have you looked at spatial hashing? Works great for web-based game engines. Happy to share some code.