
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
excalibur
Advanced tools
Excalibur.js is a simple JavaScript game engine with TypeScript bindings for making 2D games in HTML5 Canvas. Our mission is to make web game development as simple as possible.


Excalibur is a free game engine written in TypeScript for making 2D games in HTML5 canvas. Our goal is to make it easier for you to create 2D HTML/JS games, whether you're new to game development or you're an experienced game developer. We take care of all of the boilerplate engine code, cross-platform targeting (using browserstack 😎), and more! Use as much or as little as you need!
Excalibur is an open source project licensed under the 2-clause BSD license (this means you can use it in commercial projects!). It's free and always will be. We welcome any feedback or contributions! If you make something with Excalibur, please let us know!
Our user documentation is at https://excaliburjs.com/docs (and you can contribute to the docs at https://github.com/excaliburjs/Excalibur/tree/main/site)
:exclamation: Note: Excalibur is still in version 0.x, which means this project and its associated plugins may be a little rough around the edges. We try to minimize API changes, but breaking changes will occur in new released versions. Excalibur is a labor of love and the product of many hours of spare time. Thanks for checking it out!
Visit the API Reference section for fully-annotated documentation of the API.
Compiled examples can be found in the Excalibur Samples collection.
Please read our Contributing Guidelines and our Code of Conduct. Whether you've spotted a bug, have a question, or think of a new feature, we thank you for your help!
Prerequisites
docker compose build (setup build environment and installs dependencies, only needed once)docker compose run --rm dev npm run test:watchdocker compose run --rm dev npm run allWe love when people help improve our documentation. You can contribute to the docs in this repo under /site
The Excalibur.js team primarily uses Visual Studio Code as a platform agnostic editor to allow the widest contributions possible. However, you can always use your own preferred editor.
Excalibur is committed to supporting the latest 2 versions of popular desktop and mobile browsers. We leverage browserstack automated testing to ensure that Excalibur is automatically tested as thoroughly as possible on all our supported platforms.
After cloning the repository, run:
npm install
You can then run the npm tasks for various purposes:
# Run compilation, linting, and all unit & visual tests
# Recommend to do this before finalizing pull requests
npm run all
# Run engine core compilation only
# Useful for quick checks to ensure everything compiles
npm run build
# Run engine tests only (does not run compile task)
# Useful to run tests ad-hoc
npm test
npm run test
# Start Storybook-based sandbox
# Used for creating interactive visual tests and examples for docs
npm run sandbox
# Build a nuget package and specify a version
npm run nuget -- 1.1.1
Excalibur is open source and operates under the 2-clause BSD license:
BSD 2-Clause License
Copyright (c) 2014, Erik Onarheim
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[v0.31.0]
ex.Camera.setStrategies() and ex.Camera.strategies for additional control of strategy orderex.Sound({...}) option back constructor to set all the same props available on soundex.SoundManager type for managing groups of audio/sound effects/music volume in an easier wayconst soundManager = new ex.SoundManger({
channels: ['fx', 'music', 'background'],
sounds: {
jumpSnd: { sound: jumpSnd, volume: 0.4, channels: ['fx'] },
forestSnd: { sound: forestSnd, volume: 0.2, channels: ['music', 'background'] },
challengeMusic: { sound: challengeMusic, volume: 0.2, channels: ['music'] },
guitarLoop: { sound: guitarLoop, volume: 0.2, channels: ['music'] }
}
});
// play a specific sound
soundManager.play('jumpSnd');
// mute a specific channel with all member sounds
soundManager.channel.mute('music');
// mute all sound
soundManager.mute();
// unmute all sound that was previously muted, and resume playing from the current location
soundManager.unmute();
// unmute a specific channel that was muted
soundManager.channel.unmute('music');
// play a specific channel
soundManager.channel.play('music');
// set the max volume of an entire channel
soundManager.channel.setVolume('music', 0.9);
ex.Animation.data to store arbitrary meta data for an animation. Data can be directly added in the constructor as an option, by using the optional data argument in fromSpriteSheet(...) and as an option in fromSpriteSheetCoordinates({...})ex.Engine({global: ...}) where you can provide a keyboard global to override if iframe detection fails for anyway.onDeactivate(), returning data will be passed to the next SceneActivationContext in the previousSceneData property!transitionstart and transitionend events to ex.Scenesnavigation* events to ex.Engineex.Vector to specify offset and margin in SpriteSheet.fromImageSource({..})const query = new Query({
// all fields are optional
components: {
all: [ComponentA, ComponentB] as const, // important for type safety!
any: [ComponentC, ComponentD] as const, // important for type safety!
not: [ComponentE]
},
tags: {
all: ['tagA', 'tagB'],
any: ['tagC', 'tagD'],
not: ['tagE']
}
})
// previous constructor type still works and is shorthand for components.all
new Query([ComponentA, ComponentB] as const)
const query = new Query({})
maxVel attribute to MotionComponent, which clamps velocity on separated X and Y axesClock.clearSchedule(id) and have Clock.schedule return an ID so you can clear a scheduled callback before it firesParticleEmitter Particle did not receive z index value from emitter when in World spaceanim.reset() inside of an animation event handler like anim.once('end', () => anim.reset()) would not work correctlyGpuParticleEmitter did not rotate with their parentsParticleEmitter did not respect ParticleTransform.Localex.ColliderComponent/ex.BodyComponent that prevented collider tracking on entities that have ex.TransformComponent/ex.ColliderComponent, this influenced users doing Entity level ECS with pointer events.ex.Sound.play(0) would not set the volume to 0, instead the previous volume would play.onTransition on the initial scene transitionex.TriggerOptions type to all optional parametersex.GamepadButtonEvent indexto disabiguate between ex.Buttons.UnknownMap<Entity>ex.Camera.addStrategy() to accept multiple strategiesfromSpriteSheet(...), fromSpriteSheetCoordinates({...}) and clone() of ex.Animation to return the subclass if called from thereFAQs
Excalibur.js is a simple JavaScript game engine with TypeScript bindings for making 2D games in HTML5 Canvas. Our mission is to make web game development as simple as possible.
We found that excalibur demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.