- 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
PhysicsEngine
should no longer be instantiated in the Servermain.js
and in the client entry point. Rather, it should be instantiated in theGameEngine
subclass for your game.PhysicsEngine
constructor now does all initialization. Use ofinit
function is deprecated.GameEngine
step method cannot be called without passing theisReenact
argument. Games which override thestep
method must pass this argument when calling the super method.GameObject
NewonRemoveFromWorld
to mirroronAddToWorld
- Objects are now instantiated with a reference to the gameEngine, and get and ID automatically
- Method
isOwnedByPlayer
moved fromclientEngine
toGameEngine
, and theclientEngine
now sets theplayerId
in thegameEngine
.GameObject
constructor 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 aplayerId
attribute. - constructors of
DynamicObject
andPhysicalObject
have changed to the following: gameEngine, options, and props.
- Event
preInput
was 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
frameRate
has been renamed tostepRate
. ClientEngine
constructor receives a third argument, aRenderer
class. Not aRenderer
instance but the class itself.- Class
Point
has been removed. Replaced byTwoVector
andThreeVector
. DynamicObject
no longer has attributesx
,y
,velX
,velY
. instead it has attributesposition
andvelocity
which are instances ofTwoVector
. TheDynamicObject
constructor also has changed to receive argumentsposition
andvelocity
.- 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.