Socket
Socket
Sign inDemoInstall

excalibur

Package Overview
Dependencies
1
Maintainers
4
Versions
1462
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    excalibur

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.


Version published
Weekly downloads
3K
increased by135.48%
Maintainers
4
Created
Weekly downloads
 

Changelog

Source

[v0.29.2]

Breaking Changes

Deprecated

  • `

Added

  • Added ability to configure image wrapping on ex.ImageSource with the new ex.ImageWrapping.Clamp (default), ex.ImageWrapping.Repeat, and ex.ImageWrapping.Mirror.
    const image = new ex.ImageSource('path/to/image.png', {
      filtering: ex.ImageFiltering.Pixel,
      wrapping: {
        x: ex.ImageWrapping.Repeat,
        y: ex.ImageWrapping.Repeat,
      }
    });
    
  • Added pointer event support to ex.TileMap's and individual ex.Tile's
  • Added pointer event support to ex.IsometricMap's and individual ex.IsometricTile's
  • Added useAnchor parameter to ex.GraphicsGroup to allow users to opt out of anchor based positioning, if set to false all graphics members will be positioned with the top left of the graphic at the actor's position.
    const graphicGroup = new ex.GraphicsGroup({
      useAnchor: false,
      members: [
        {
          graphic: heartImage.toSprite(),
          offset: ex.vec(0, 0),
        },
        {
          graphic: heartImage.toSprite(),
          offset: ex.vec(0, 16),
        },
        {
          graphic: heartImage.toSprite(),
          offset: ex.vec(16, 16),
        },
        {
          graphic: heartImage.toSprite(),
          offset: ex.vec(16, 0),
        },
      ],
    });
    
  • Added simplified ex.coroutine overloads, you need not pass engine as long as you are in an Excalibur lifecycle
    const result = ex.coroutine(function* () {...});
    
  • Added way to bind 'this' to ex.coroutine overloads, you need not pass engine as long as you are in an Excalibur lifecycle
    const result = ex.coroutine({myThis: 'cool'}, function* () {...});
    
  • Added optional ex.coroutine timing parameter to schedule when they are updated
    const result = ex.coroutine(engine, function * () {...}, { timing: 'postupdate' })
    
  • Added GraphicsComponent.bounds which will report the world bounds of the graphic if applicable!
  • Added ex.Vector.EQUALS_EPSILON to configure the ex.Vector.equals(v) threshold
  • Added way to add custom WebGL context lost/recovered handlers for your game
    const game = new ex.Engine({
      handleContextLost: (e) => {...},
      handleContextRestored: (e) => {...}
    })
    

Fixed

  • Fixed issue where ex.TileMap culling did not work properly when using fixed updates lower than refresh rate
  • Fixed incomplete types for font options in ex.FontSource().toFont(options)
  • Fixed issue with ex.Loader start button position when using CSS transforms
  • Fixed issue where adding scenes with the same name did not work when it was previously removed
  • Fixed issue when WebGL context lost occurs where there was no friendly output to the user
  • Fixed issue where HiDPI scaling could accidentally scale past the 4k mobile limit, if the context would scale too large it will now attempt to recover by backing off.
  • Fixed issue where logo was sometimes not loaded during ex.Loader
  • Fixed issue where unbounded containers would grow infinitely when using the following display modes:
    • DisplayMode.FillContainer
    • DisplayMode.FitContainer
    • DisplayMode.FitContainerAndFill
    • DisplayMode.FitContainerAndZoom
  • Fixed issue where ex.ParticleEmitter z-index did not propagate to particles
  • Fixed incongruent behavior as small scales when setting transform.scale = v and transform.scale.setTo(x, y)
  • Fixed ex.coroutine TypeScript type to include yielding undefined
  • Fixed issue where Firefox on Linux would throw an error when using custom Materials due to unused attributes caused by glsl compiler optimization.
  • Fixed issue where start transition did not work properly if deferred
  • Fixed issue where transitions did not cover the whole screen if camera was zoomed
  • Fixed issue where Color.toHex() produced invalid strings if the channel values are negative or fractional, or if the alpha channel was different than 1

Updates

Changed

  • Significant 2x performance improvement to image drawing in Excalibur
  • Simplified ex.Loader viewport/resolution internal configuration

Readme

Source

Logo

Appveyor status Coverage Status npm version npm downloads NuGet version Discord

Sweep Stacks

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!

Get Started

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!

API Reference

Visit the API Reference section for fully-annotated documentation of the API.

Questions

Samples

Compiled examples can be found in the Excalibur Samples collection.

Contributing

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!

Mac/Linux

Prerequisites

  • Docker for Mac https://docs.docker.com/desktop/mac/install/
  • In the root, run docker-compose build (setup build environment and installs dependencies, only needed once)
  • To run tests in watch mode docker-compose run --rm dev npm run test:watch
  • To run a build docker-compose run --rm dev npm run all

Writing Documentation

We love when people help improve our documentation. You can contribute to the docs in this repo under /site

Environment Setup

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.

Testing

Browserstack

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.

Prerequisites

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

License

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.

Keywords

FAQs

Last updated on 07 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc