News for hackers. Stuff that matters.
Re:MelonJS – a fresh and lightweight JavaScript game engine by aww_dang on Wednesday December 21, 2022 @12:44AM (#34077120)
I built a multiplayer rougelikelike pvp action RPG on Melon.js back in 2018. My first game.

I went through most of these issues and solved them.

For my case it was simple to reimplement the physics server side as there were no fancy physics. Just simple collisions. There is no alternative if you want to avoid cheaters.

If you have an entity's position and speed at a given time, you can then calculate the position going forward. A misstep here is assuming that your client's game speed in pixels is consistent. You may need to normalize the entity's speed based upon the client's frame rate. Do this for both displaying entities and reporting the player's movement to the server.

Hop on the Melon.js Discord if you have specific questions.

There are no comments on this comment yet.