- TypeScript Support
- major version upgrades on dependencies - fixing npm audit
- move to newer socket.io
- 2D Physics Support via P2
- New sample game Asteroids
- Interpolation mode
- Common bending code
- new netscheme data type: STRING. Will only be broadcast if it changed since last broadcast.
- PhysicsEngine no longer initialized in two places. It is initialized in the GameEngine
- Implemented HSHG collision detection for SimplePhysics
- Implemented ClientEngine standaloneMode for network-less testing of game engines
- New KeyboardControls class to help with sending key-based input
- Moved to es6 modules on all games
- ES6 Modules: Modules are imported using the "import from" construct. For example import GameEngine from 'lance/GameEngine' instead of const GameEngine = require(...)
- ES6 Modules: Games must configure webpack.config.js. See sample game
- ES6 Modules: Babel must be configured in order to run es6 modules on node server-side, by creating a .babelrc file. See sample game
- Renderer-controlled game loop support: the physics engine is asked to step forwards by dt, where dt is the time between current frame render and last frame render
- full-sync support for updating all game objects when new player connects
- Renderer refactored as a singleton, and instantiated only on client
- Render objects and Physics objects are now sub-objects of the GameObject
- All classes are now in ES6 format instead of CommonJS
PhysicsEngineshould no longer be instantiated in the Servermain.jsand in the client entry point. Rather, it should be instantiated in theGameEnginesubclass for your game.PhysicsEngineconstructor now does all initialization. Use ofinitfunction is deprecated.GameEnginestep method cannot be called without passing theisReenactargument. Games which override thestepmethod must pass this argument when calling the super method.GameObjectNewonRemoveFromWorldto mirroronAddToWorld- Objects are now instantiated with a reference to the gameEngine, and get and ID automatically
- Method
isOwnedByPlayermoved fromclientEnginetoGameEngine, and theclientEnginenow sets theplayerIdin thegameEngine.GameObjectconstructor is therefore: constructor(gameEngine, options, props) and must call the super constructor correspondingly - The
GameWorld.getPlayerObject()method has been removed, you can get the player objects using theGameWorld.query()method, passing aplayerIdattribute. - constructors of
DynamicObjectandPhysicalObjecthave changed to the following: gameEngine, options, and props.
- Event
preInputwas renamed toprocessInput,client__processInput,server__processInput.postInput. This is a breaking change but no one actually used these events.
- Server only sends updates for objects which changed
- A-Frame support
- Cannon.js support
- 3D support
Note that this is a major release update, which breaks current games. To upgrade to this latest major release 1.0.0, you will need to apply the following changes:
- Option
frameRatehas been renamed tostepRate. ClientEngineconstructor receives a third argument, aRendererclass. Not aRendererinstance but the class itself.- Class
Pointhas been removed. Replaced byTwoVectorandThreeVector. DynamicObjectno longer has attributesx,y,velX,velY. instead it has attributespositionandvelocitywhich are instances ofTwoVector. TheDynamicObjectconstructor also has changed to receive argumentspositionandvelocity.- The concept of bending has been redefined so that 0.0 means no bending towards the server value, and 1.0 means total bending towards the server value until the next server update.