Coder Social home page Coder Social logo

excaliburjs / excalibur Goto Github PK

View Code? Open in Web Editor NEW
1.7K 35.0 188.0 297.08 MB

๐ŸŽฎ Your friendly TypeScript 2D game engine for the web ๐Ÿ—ก๏ธ

Home Page: https://excaliburjs.com

License: BSD 2-Clause "Simplified" License

JavaScript 8.78% HTML 1.55% TypeScript 77.42% CSS 0.36% GLSL 0.33% Dockerfile 0.02% MDX 11.52%
excalibur game-development game-engine gamedev typescript html5-canvas game-framework games excaliburjs

excalibur's People

Contributors

alanag13 avatar andrewmbyrd avatar autsider666 avatar carghaez avatar catrielmuller avatar crizzooo avatar davidli119 avatar davince avatar dependabot[bot] avatar djcsdy avatar eonarheim avatar guahanweb avatar hogart avatar htalat avatar jasonlh-harris avatar jedeen avatar jumplink avatar jyoung4242 avatar kamranayub avatar loserantbear avatar mattjennings avatar miqh avatar mrkmg avatar muhajirdev avatar nidble avatar puritylake avatar renovate-bot avatar renovate[bot] avatar t00mm avatar xstoudi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

excalibur's Issues

Grid partioning for collision detection

This will improve the performance of grid based collision detection.

//x, y, cellWidth, cellHeight, rowCount, colCount
var collisionMap = new CollisionMap(....);

var somethingUseful = collisiomMap.collides(actor);

Label color is hard coded to black when no SpriteFont is supplied

      ctx.save();
      ctx.translate(this.x, this.y);
      ctx.scale(this.scale, this.scale);
      ctx.rotate(this.rotation);
        if(this.spriteFont){
            this.spriteFont.draw(ctx, 0, 0, this.text); 
        }else{
            ctx.fillStyle = 'black';
            ctx.fillText(this.text, 0, 0);
        }

        super.draw(ctx, delta);
        ctx.restore();

Add new event types for actors and engine

Actor

Enter view port event - 'enterviewport'
Exit view port event - 'exitviewport'
More specific collision events - 'collidesbottom', 'collidestop', 'collidesleft', collidesright'

Engine

load
gamestart
Key Combinations - 'ctrl+b'
mousemove
touchstart
touchend
touchmove
touchcancel

Events should be thrown in the context of an Actor

Currently when events are thrown the are emitted as "global", which means that multiple collision events may be thrown and every actor must check whether the event applies to them. This is incredibly inefficient, the EventDispatcher should only send events to actors that apply to them.

New Collision Primitives

The engine needs new collision primitives that can collide with one another like:

BoundingCircle
BoundingBox
BoundingPoly
BoundingPixels

Color constants

var red = Color.RED;
var blue = Color.BLUE;
var green = Color.GREEN;

Add glow/shadow effects to engine

I suspect we will need to play some tricks with an off screen canvas, after running some tests, the canvas shadowBlur is too slow.

Play animations anywhere in the game

Engine needs to be part of the animation constructor for this to work.

var animation = new Animation(images, engine, ....);
animation.play(x,y);

Create resource loader to preload all images and sound

The loader should also display a progress bar indicating progress.

The progress bar drawing should be overloadable as well.

Something like

var loader = new Loader();
loader.addSound(somesound);
loader.addImage(someimage);
loader.addSpriteSheet(somess);
game.loader = loader;

or

game.start(loader);

or on game init

var game = new Game(600,400,'#game', loader);

Add toggle for debug output

Right now key press debug output is always drawn to the screen. Add a flag to the game container.

Maybe add an api for developers to attach a key press to toggle debug output.

Add storage API to allow persistence

StorageManager

Probably better as an Excalibur plug-in/feature.

  • Abstract storage (amplify.store?)
  • Stores "schema" version and handles migrations (up/down)
  • get/set methods
  • TypeScript generic support

Pseudocode

interface IPersistenceStore {
  version: string;
  migrations: IMigration[];

  init(): void;
  get<T>(key: string): T;
  store(key: string, value: any): void;
  // ... promises?
}

var storage: ex.Storage.IPersistenceStore = new ex.Storage.AmplifyStore("my-game-store");

// handle versioning?
storage.version = "2.0";
storage.migrations.add("1.0", "2.0", 
  (from, to) => { // from
  },
  (to, from) => { // to
  }); // ex.Storage.IVersionMigration

// set options
...

// load up existing DB/create new one and run migrations
storage.init();

// get prefs
var prefs = storage.get<IPreferences>("preferences");

// update prefs
prefs.showTutorials = false;

// store prefs
storage.store("preferences", prefs);

Hopefully we can just wrap storage providers rather than build our own. Really we just want to handle versioning.

Add Sound Sprite functionality

The idea of a sound sprite that push all your sound effects into a single sound file, so only one trip to the server is made. Similar to the idea behind atlases or sprite sheets.

Need a way to encode offsets and lengths to play the appropriate sound in the sound sprite.

Sprite Fonts!

This is useful when you want to use retro fonts from sprite sheets

Error thrown in engine on game start

An unknown error is being thrown at the start of the game.

It looks to be an 'undefined' eventName being passed to the event dispatcher publish

[DEBUG] : Game started Engine.js:970
Uncaught TypeError: Cannot call method 'toLowerCase' of undefined Engine.js:1159
[DEBUG] : Game stopped Engine.js:970

Add logging to engine

A logging setup around the concept of appenders would be useful and extensible as in log4j or log4net.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.