Maybe this is more a big patch than a feature, but it's a primer for marble bots and (eventually) support for different game modes!
And for worker threads but let's not talk about that.
Major changes:
All race-related logic has been moved from game.js to the DefaultRace class, along with some other changes:
Added the STATE_PREPARING game state, for any preparation logic needed right before the race start.
Marble attribute checks have been moved from commands.js to DefaultRace, and have been rewritten.
Added the RaceEntry class.
Database writes are now handled by race instances.
game can no longer directly spawn marbles, though game.addRaceEntry can still be used to spawn bots at any time.
Minor changes:
Fixed colored logging not working on server-side worker threads.
Fixed/cleaned up the physics module initialization (which also resolved a circular dependency).
Physics world automatically starts/stops simulation based on any existing marbles.
Added physicsWorld.clearMarbles()
Other small changes / new helper functions to make the code less error-prone.
Maybe this is more a big patch than a feature, but it's a primer for marble bots and (eventually) support for different game modes!
And for worker threads but let's not talk about that.Major changes:
game.js
to theDefaultRace
class, along with some other changes:STATE_PREPARING
game state, for any preparation logic needed right before the race start.commands.js
toDefaultRace
, and have been rewritten.RaceEntry
class.game
can no longer directly spawn marbles, thoughgame.addRaceEntry
can still be used to spawn bots at any time.Minor changes:
physicsWorld.clearMarbles()