It no longer works on the game but on the screen. I imagine this object being a visual component. Actor.jsįrom component, adds position and rotation to a component. I like to think of this as an on-screen text buffer i can write to for debugging or HUD. For simplicity Game initiliazes with a textManager. TextManager.jsĪ reusable text management system. Provides physics and an integration step to support position, velocity, and acceleration. Differs from an actor as is applies to the game not in the game.
CONSTRUCTOR GAME ENGINE UPDATE
Component.jsĪ simple objects managed by the engine, supports update and render methods. The core game engine implements a CollectionManager and exposes an add method directly upon the Game instance. Game.entityManagerĪ container for managing entites to be updated and rendered on demand of the game engine. Game is the central component in the engine, it ties all of the subsystems together. Game.singletonInstance runs the main animation loop and is a very light engine, calls update and render on entities passing appropriate context for entities and input. I've already found a few shortcomings by not supplying a constructor method directly in assuming init is the constructor. This is essentially a strict and ecmascript 5 version of john resigs simple inheritance ideas. In each loop the game engine executes and updates followed by a render call for each entity in the system. Heavily tested 2d game engine written in JavaScript.