This project is deprecated in favor of Voltar, yet I keep the latest version as a private repo due to lots of in-house specific code for our studio.
A module based HTML5 game engine designed to be flexible and powerful.
LesserPanda has a lot of features, and the list is still growing:
FPS
.Timer
, Gfx
, Physics
and Anime
.Entity
class.Samples are moved to its own repo here.
Currently the samples are located inside src/game/samples
folder, and each is just a simple Game
focusing on one or more particular feature.
Note: Samples have not been converted to latest v1.x yet.
Devlog posts what happened to LesserPanda, read them at wiki, it will be updated on each Wednesday.
anime
provides both common tween animation and Blender like action
.audio
provides sound playback functions, the basic usage is included in the game/main
.gfx
contains whole PIXI.js sources. Filters and mesh is disabled by default, you can enable them by uncomment related lines in engine/pixi/index.js
.polyfill
contains some ES6 polyfills (Object.assign
, rAF
and Math.sign
).loader
brings resource loading functionality which is used by PIXI.js and you probably don't need to use it directly.storage
provides session and persistent data storage. session
and persistent
from this module is quite useful but you can also use low level storage
.analytics
provides some helper functions to work with Google Analytics.Camera
2D camera that can follow targets, zoom, rotate and shake.core
is the core of lesser-panda, which provides the base functionalities such as "loop" and "resize".device
tells what device the game is currently running.EventEmitter
is a fast EventEmitter implementation.input
provides keyboard events and key-maps.loader
provides assets loading functon addAsset(path, key, settings)
physics
provides AABB/SAT based collision detection and response.resize
provides some resize helper functions.rnd
is a random number generator.Game
is the main hub for your game.timer
provides timers with callbacks. Use game.timer.later
or game.timer.interval
to create instances.utils
provides utility functions and constants for array, color, math, object.Vector
is the 2D vector class, with tons of useful methodsBehavior
interface for behaviors of Entity
System
interface for all the sub-systems of Game
There's a Trello board, from which you will see what's coming next. Github issue and milestone maybe better for progress tracking~
SATSolver
Polygon
collision shapeonRotationChange
signal to Entity
and let components subscribe to rotation changes on attachSystem
prefix from all the system classesTimer
to Clock
and SystemTimer
to Timer
engine/gfx/core/math
moduleAABBSolver
separating issueCollider.prototype.last
updating and solves a poolable
related issue at the same time.AnimatedSprite
now accept more texture list formats.poolable
utility.CutoutAnimatedSprite
to COASprite
.CutoutAnimatedSprite
that support scon
formatted animation from Spriter.core.speed
in favor of Game.prototype.timeScale
.addComponent
, this.gfx = Node()
will no longer work.scale
between components of Entity
since gfx scales a lot but colliders won'tEntity
will now be save as a property. (Health
will become bhvHealth
)Entity.prototype.behaviors
is now a list of behaviorsComponent.rotation
not work issue.OVERLAP
collision state, now boxes will never overlap if they intend to push against otherscollide
API (now pass in a direction(Object) parameter)addComponent
instead while the old way still worksEntity
APICollider
to toggle map collisionThis version contains some breaking change, but I won't bump it to v1.1 since all the changes
are applied to the built-in gfx
module. It does not affect any public APIs.
DisplayObject
and Container
into one and rename it as Node
.fromImage
and fromFrame
functions from Gfx
elements, loader
should be used instead.sprite.texture = 'my_image.png'
)input
system support key-maps bindings, on top of keyboard
.CollisionMap
implementation supports AABB vs rect tile collision.package.json
file and install whatever packages)Scene
-> Game
.Actor
-> Entity
.gfx
and physics
modules.BackgroundMap
ability to repeat.width
, height
, widthInTile
and heightInTile
properties to BackgroundMap
.getTile
and setTile
method to BackgroundMap
.BackgroundMap
rendering, by drawing the visible part only.isStatic
field to physics.Body
to identify bodies don't move and response to the collisions, which also improves the performance of CollisionMap
.Tween
to prevent issues caused by object pooling.tiledToMap
and convert to latest level
format.level
module that can load a level from data.Scene.getActorByName
method.core.setScene
to be able to create new instance for the next scene.Actor.register
function to register custom(subclass) Actor
classes with a key.actor
module, so scenes won't be able to spawn actors until you import the actor
module.Body
setup.Body.anchor
since it's not supported by SAT solver.Scene.createLayer
method to simplify layer creating.Scene.spawnActor
are not optional.vertical
and horizontal
settings to WrapAroundScreen behavior.never
resize mode is deprecated.Camera
to be able to work without any targets.poolable
module to utils
.FireBullet
behavior, now it has ammo
support built-in.Behavior
no longer inherits from EventEmitter
.Actor
spawn/remove behavior changed, now it's possible to maunally create Actor
instance and add to any scene instead of calling spawnActor
. Object pool support is included.Actor.prepare
to Actor.ready
.rotate-around-point
behaviorsteering
behaviorface-the-mouse
behaviorgetTexture
function to engine.loader
to be able to get texture from string.start
function to core
module as a easy replacement of startWithScene
.canvasquery
module is removed.Actor
system and make it more powerful yet easier to work with.Behavior
system.prepare
method to Actor
which will be called at the end of addTo
.Tilemap
support for both built-in format or Tiled JSON map(some custom properties are required)Timer.now
to represent time passed since game started.top
and bottom
properties to Camera
object.width
and height
properties to physics.Body
, which map to shape.width
and shape.height
.Actor
, SpriteActor
, AnimatedActor
and PrimitiveActor
classes.Behavior
base class and some simple behaviors.pause
and resume
events from core
.Body.collisionAgainst
to a 32bit integer number while broadPhase is SpatialHash.device-patch
module to solve device specific issues.engine.resolution
.PIXI.extras.Animation
is now renamed as PIXI.extras.AnimatedSprite
.Animation
system(formerly called Timeline
), now the tweening of nested properties is supported.dom
resize mode.Texture.fromAsset
method, use loader.resources
instead.master/3.0.11
baseURL
any more.master/3.0.10
loader.addAsset
functiontag
support to Object
, Timeline
and Timer
sub-systems, now it is possible to pause/resume any tagged components. For example you can easily pause the timelines tagged object and keep the ui when game is paused.boot
and booted
events when engine is started.Kefir
and add a emitter
function to create self emittable streams for convenience.session
and persistent
data manager for easier data saving without touching low-level storage
and localStorage
.stage
instead of container
PIXI.extras.Animation
updating logicgame
).Class
system due to performance and capabilities.LesserPanda is released under the MIT License, the same as Panda.js engine.
@ekelokorpi for creating the awesome panda.js-engine
@Pixel-boy for the lovely bat(bat.png
in media folder)