Skip to content

Releases: NTaylorMullen/EndGate

0.2.1

07 Dec 04:22
Compare
Choose a tag to compare

This is a point release of the EndGate framework built to be compatible with the latest TypeScript release (0.9.5).

If you're updating from an EndGate version < 0.2.0 check out the breaking change list here.

0.2.0

15 Oct 04:53
Compare
Choose a tag to compare

This is a major release of the EndGate framework. Several breaking changes are included in this release as well as several significant features and a few bug fixes.

Breaking Changes

  • The MapManager and Scenery handler have been removed. #68

In previous releases you could add "scenery" to the game by doing the following within your game class:

this.Map.Scenery.AddLayer(...);

Now the equivalent of this is:

this.Scene.Add(...);

Note: ZIndexes between existing scenery objects will now be competing for draw order against other element within the game scene.


  • Game canvases are no longer styled. #80

In previous releases EndGate required two game canvases because of the SceneryHandler. Now that the SceneryHandler is gone there's no need for all the styling on the base game canvas so a game canvas will appear exactly how it is built and will not be altered.


  • TileMap and SquareTileMap have been moved to the Graphics namespace. #66

Before:

var stm: eg.Map.SquareTileMap,
    tm: eg.Map.TileMap,
    st: eg.Map.SquareTile;

Now:

var stm: eg.Graphics.SquareTileMap,
    tm: eg.Graphics.TileMap,
    st: eg.Graphics.Assets.SquareTile;

  • AudioManager has been removed. #57

Before (inside a game):

this.Audio.Load("myAudio", "foo/bar.mp3");
this.Audio.Play("myAudio");
this.Audio.GetAudioPlayer("myAudio");
this.Audio.Unload("myAudio");

Now (equivalent inside a game):

var player = this.Content.LoadAudio("myAudio", "foo/bar.mp3");
player.Play();
this.Content.GetAudio("myAudio"); // This return value is "player"
this.Content.UnloadAudio("myAudio");

  • SquareTileMap's are now loaded asynchronously. #35

Before:
SquareTileMap's loaded all tiles synchronously resulting in them being drawn as a full loaded graphic once they were added to the scene. (If the maps were too big the page would freeze)
Now:
SquareTileMap's load tiles asynchronously. To have near the same behavior as before you should tie into the SquareTileMap's OnLoaded event handler to determine when the SquareTileMap has finished loading. Otherwise you can keep your existing code if you don't mind seeing SquareTileMap's loaded in asynchronously (you will see the map load in row by row).


  • Moved the ImageSource object to the Graphics namespace. #32

Before:

var source: eg.Graphics.Assets.ImageSource;

Now:

var source: eg.Graphics.ImageSource;

  • Moved CollisionData from the eg.Collision.Assets namespace into the eg.Collision namespace. #71
  • Removed the At property from CollisionData. #23

Before:

class MyCollidable extends eg.Collidable {
    constructor() {
        super(new eg.Bounds.BoundingCircle(eg.Vector2d.Zero, 3));
    }

    public Collided(data: eg.Collision.Assets.CollisionData): void {
        var iCollidedAt: eg.Vector2d = data.At;
    }
}

Now:

class MyCollidable extends eg.Collidable {
    constructor() {
        super(new eg.Bounds.BoundingCircle(eg.Vector2d.Zero, 3));
    }

    // Note that CollisionData is now in the Collision namespace.
    public Collided(data: eg.Collision.CollisionData): void {
        // All At did was capture the position of "me", so there's really no need to capture that value because we already have it!
        var iCollidedAt: eg.Vector2d = this.Bounds.Position;
    }
}

  • Moved Graphic2d, Bounds2d, and MovementController out of their Abstraction namespaces. #19

Before:

var graphic: eg.Graphics.Abstractions.Graphic2d,
    bounds: eg.Bounds.Abstractions.Bounds2d,
    movementController: eg.MovementControllers.Abstractions.MovementController;

Now:

var graphic: eg.Graphics.Graphic2d,
    bounds: eg.Bounds.Bounds2d,
    movementController: eg.MovementControllers.MovementController;

  • Graphic2d's with colors (Shape's and Line2d) have their colors default to black so that they're not invisible by default. #78

Before:

var transparentCircle = new eg.Graphics.Circle(0, 0, 5);

Now:

var transparentCircle = new eg.Graphics.Circle(0, 0, 5, eg.Graphics.Color.Transparent);

  • The Map namespace has been removed. #70
  • Mouse events prevent all default actions on the games canvas, this involves not allowing right click -> context menu. #55
  • Renamed Graphic2d's Children() method to GetChildren(). #55
  • Renamed ImageSource's Loaded() method to IsLoaded(). #41
  • Moved the Opacity property onto the Graphic2d class, before it was implemented individually on all of the drawable graphics, now it's inherited. #33

Features

  • Added a LoadContent method to the game class. This method is triggered at the end of the "super()" call. All content is loaded in asynchronously, to wait on loaded content capture the results from the Content's LoadImage function and wait on the OnLoaded event for those objects to be triggered. #28
  • Added a ContentManager that can be accessed from inside a game object. #27

Usage:

class MyGame extends eg.Game {
    constructor() {
        super();

        var image1: eg.Graphics.ImageSource = this.Content.GetImage("myFirstImage"),
            audio1: eg.Sound.AudioPlayer = this.Content.GetAudio("myFirstAudio");
    }

    public LoadContent(): void {
        this.Content.LoadImage("myFirstImage", "/images/foo.png");
        this.Content.LoadAudio("myFirstAudio", "/audio/foo.mp3");        
    }
}

  • Added a new Color object. #30
  • Modified existing graphics "Color" properties to utilize the new Color object. #72

Usage:

var circle = new eg.Graphics.Circle(0, 0, 5, "red");

// Change the circle's color to yellow (multiple different ways, all are equivalent)
circle.Color.G = 255; // Since we initialized it to red, changing the green component to 255 makes yellow
circle.Color = "yellow";
circle.Color = eg.Graphics.Color.Yellow;
circle.Color = new eg.Graphics.Color(255, 255, 0);
circle.Color = new eg.Graphics.Color(255, 255, 0, 1);
circle.Color = new eg.Graphics.Color("yellow");
circle.Color = new eg.Graphics.Color("rgb(255, 255, 0)");
circle.Color = new eg.Graphics.Color("rgba(255, 255, 0, 1)");

  • Added a particle emitter. Checkout the Particles sample to see more capabilities of particle emitters. #26

Usage:

class MyGame extends eg.Game {
    private _emitter: eg.Particles.Emitter;

    constructor() {
        super();

        var emitter = new eg.Particles.Emitter(0, 0, eg.Tweening.Functions.Linear.EaseNone);

        // Build a pool of textures that the emitter randomly selects to emit.
        emitter.AddTexture(new eg.Graphics.Circle(0, 0, 5, "red"));
        emitter.AddTexture(new eg.Graphics.Rectangle(0, 0, 10, 10, "green"));
        emitter.AddTexture(new eg.Graphics.Line2d(0, 0, 10, 10, 3, "black"));
        emitter.AddTexture(new eg.Graphics.Text2d(0, 0, "Hello World", "blue"));

        emitter.Start();

        // Emitter has several different properties that can be modified to affect how the emitter emits particles.  Take a look at the Particles sample to learn more.

        this.Scene.Add(emitter);

        this._emitter = emitter;
    }

    public Update(gameTime: eg.GameTime): void {
        this._emitter.Update(gameTime);
    }
}

Usage:

class MyGame extends eg.Game {
    private _tween: eg.Tweening.ColorTween;

    constructor() {
        super();

        var graphic = new eg.Graphics.Circle(0, 0, 30, "red"),
            tween = new eg.Tweening.ColorTween(graphic.Color, eg.Graphics.Color.Blue, eg.TimeSpan.FromSeconds(1), eg.Tweening.Functions.Linear.EaseNone);

        tween.OnChange.Bind((newColor: eg.Graphics.Color) => {
            graphic.Color = newColor;
        });

        tween.Play();

        this.Scene.Add(graphic);

        this._tween = tween;
    }

    public Update(gameTime: eg.GameTime): void {
        this._tween.Update(gameTime);
    }
}

Usage:  

class MyGame extends eg.Game {
    constructor() {
        super();
    }

    public LoadContent(): void {
        // This assumes "mapJson" is set to your maps JSON data.
        eg.MapLoaders.JSONLoader.Load(mapJson, (result: eg.MapLoaders.IMapLoadedResult) => {
            // Triggered when the map has finished loading
            for(var i = 0; i < result.Layers.length; i++) {
                this.Scene.Add(result.Layers[i]);
            }
        };
    }
}

  • The CollisionManager has been highly optimized. It now uses a dynamically re-sizing quad tree for speedy collision checks. This also involved adding a new parameter to the CollisionManager's Monitor method to indicate if a Collidable is static or not. If a Collidable is static it means that it will not move throughout its life time and it cannot collide with other static objects (since they don't move). #6
class Rock extends Collidable {
    constructor() {
        super(new eg.Bounds.BoundingCircle(eg.Vector2d.Zero, 10));
    }
}

class MyGame extends eg.Game {
    constructor() {
        super();

        /*
        * To further optimize the QuadTree you can change the games collision configuration
        * Aka: this.Configuration.CollisionConfiguration.MinQuadTreeNodeSize and this.Configuration.CollisionConfiguration.InitialQuadTreeSize
        */

        // Monitor ...
Read more

0.2.0-beta2

22 Aug 05:11
Compare
Choose a tag to compare
0.2.0-beta2 Pre-release
Pre-release

Updated the EndGate library to work with TypeScript 0.9.1+.

Make sure to check out the release notes for 0.2.0-beta1 here.

0.2.0-beta1

20 Aug 06:35
Compare
Choose a tag to compare
0.2.0-beta1 Pre-release
Pre-release

This is a major release of the EndGate framework. Several breaking changes are included in this release as well as several significant features and a few bug fixes.

Breaking Changes

  • The MapManager and Scenery handler have been removed. #68

In previous releases you could add "scenery" to the game by doing the following within your game class:

this.Map.Scenery.AddLayer(...);

Now the equivalent of this is:

this.Scene.Add(...);

Note: ZIndexes between existing scenery objects will now be competing for draw order against other element within the game scene.


  • Game canvases are no longer styled. #80

In previous releases EndGate required two game canvases because of the SceneryHandler. Now that the SceneryHandler is gone there's no need for all the styling on the base game canvas so a game canvas will appear exactly how it is built and will not be altered.


  • TileMap and SquareTileMap have been moved to the Graphics namespace. #66

Before:

var stm: eg.Map.SquareTileMap,
    tm: eg.Map.TileMap,
    st: eg.Map.SquareTile;

Now:

var stm: eg.Graphics.SquareTileMap,
    tm: eg.Graphics.TileMap,
    st: eg.Graphics.Assets.SquareTile;

  • AudioManager has been removed. #57

Before (inside a game):

this.Audio.Load("myAudio", "foo/bar.mp3");
this.Audio.Play("myAudio");
this.Audio.GetAudioPlayer("myAudio");
this.Audio.Unload("myAudio");

Now (equivalent inside a game):

var player = this.Content.LoadAudio("myAudio", "foo/bar.mp3");
player.Play();
this.Content.GetAudio("myAudio"); // This return value is "player"
this.Content.UnloadAudio("myAudio");

  • SquareTileMap's are now loaded asynchronously. #35

Before:
SquareTileMap's loaded all tiles synchronously resulting in them being drawn as a full loaded graphic once they were added to the scene. (If the maps were too big the page would freeze)
Now:
SquareTileMap's load tiles asynchronously. To have near the same behavior as before you should tie into the SquareTileMap's OnLoaded event handler to determine when the SquareTileMap has finished loading. Otherwise you can keep your existing code if you don't mind seeing SquareTileMap's loaded in asynchronously (you will see the map load in row by row).


  • Moved the ImageSource object to the Graphics namespace. #32

Before:

var source: eg.Graphics.Assets.ImageSource;

Now:

var source: eg.Graphics.ImageSource;

  • Moved CollisionData from the eg.Collision.Assets namespace into the eg.Collision namespace. #71
  • Removed the At property from CollisionData. #23

Before:

class MyCollidable extends eg.Collidable {
    constructor() {
        super(new eg.Bounds.BoundingCircle(eg.Vector2d.Zero, 3));
    }

    public Collided(data: eg.Collision.Assets.CollisionData): void {
        var iCollidedAt: eg.Vector2d = data.At;
    }
}

Now:

class MyCollidable extends eg.Collidable {
    constructor() {
        super(new eg.Bounds.BoundingCircle(eg.Vector2d.Zero, 3));
    }

    // Note that CollisionData is now in the Collision namespace.
    public Collided(data: eg.Collision.CollisionData): void {
        // All At did was capture the position of "me", so there's really no need to capture that value because we already have it!
        var iCollidedAt: eg.Vector2d = this.Bounds.Position;
    }
}

  • Moved Graphic2d, Bounds2d, and MovementController out of their Abstraction namespaces. #19

Before:

var graphic: eg.Graphics.Abstractions.Graphic2d,
    bounds: eg.Bounds.Abstractions.Bounds2d,
    movementController: eg.MovementControllers.Abstractions.MovementController;

Now:

var graphic: eg.Graphics.Graphic2d,
    bounds: eg.Bounds.Bounds2d,
    movementController: eg.MovementControllers.MovementController;

  • Graphic2d's with colors (Shape's and Line2d) have their colors default to black so that they're not invisible by default. #78

Before:

var transparentCircle = new eg.Graphics.Circle(0, 0, 5);

Now:

var transparentCircle = new eg.Graphics.Circle(0, 0, 5, eg.Graphics.Color.Transparent);

  • The Map namespace has been removed. #70
  • Mouse events prevent all default actions on the games canvas, this involves not allowing right click -> context menu. #55
  • Renamed Graphic2d's Children() method to GetChildren(). #55
  • Renamed ImageSource's Loaded() method to IsLoaded(). #41
  • Moved the Opacity property onto the Graphic2d class, before it was implemented individually on all of the drawable graphics, now it's inherited. #33

Features

  • Added a LoadContent method to the game class. This method is triggered at the end of the "super()" call. All content is loaded in asynchronously, to wait on loaded content capture the results from the Content's LoadImage function and wait on the OnLoaded event for those objects to be triggered. #28
  • Added a ContentManager that can be accessed from inside a game object. #27

Usage:

class MyGame extends eg.Game {
    constructor() {
        super();

        var image1: eg.Graphics.ImageSource = this.Content.GetImage("myFirstImage"),
            audio1: eg.Sound.AudioPlayer = this.Content.GetAudio("myFirstAudio");
    }

    public LoadContent(): void {
        this.Content.LoadImage("myFirstImage", "/images/foo.png");
        this.Content.LoadAudio("myFirstAudio", "/audio/foo.mp3");        
    }
}

  • Added a new Color object. #30
  • Modified existing graphics "Color" properties to utilize the new Color object. #72

Usage:

var circle = new eg.Graphics.Circle(0, 0, 5, "red");

// Change the circle's color to yellow (multiple different ways, all are equivalent)
circle.Color.G = 255; // Since we initialized it to red, changing the green component to 255 makes yellow
circle.Color = "yellow";
circle.Color = eg.Graphics.Color.Yellow;
circle.Color = new eg.Graphics.Color(255, 255, 0);
circle.Color = new eg.Graphics.Color(255, 255, 0, 1);
circle.Color = new eg.Graphics.Color("yellow");
circle.Color = new eg.Graphics.Color("rgb(255, 255, 0)");
circle.Color = new eg.Graphics.Color("rgba(255, 255, 0, 1)");

  • Added a particle emitter. Checkout the Particles sample to see more capabilities of particle emitters. #26

Usage:

class MyGame extends eg.Game {
    private _emitter: eg.Particles.Emitter;

    constructor() {
        super();

        var emitter = new eg.Particles.Emitter(0, 0, eg.Tweening.Functions.Linear.EaseNone);

        // Build a pool of textures that the emitter randomly selects to emit.
        emitter.AddTexture(new eg.Graphics.Circle(0, 0, 5, "red"));
        emitter.AddTexture(new eg.Graphics.Rectangle(0, 0, 10, 10, "green"));
        emitter.AddTexture(new eg.Graphics.Line2d(0, 0, 10, 10, 3, "black"));
        emitter.AddTexture(new eg.Graphics.Text2d(0, 0, "Hello World", "blue"));

        emitter.Start();

        // Emitter has several different properties that can be modified to affect how the emitter emits particles.  Take a look at the Particles sample to learn more.

        this.Scene.Add(emitter);

        this._emitter = emitter;
    }

    public Update(gameTime: eg.GameTime): void {
        this._emitter.Update(gameTime);
    }
}

Usage:

class MyGame extends eg.Game {
    private _tween: eg.Tweening.ColorTween;

    constructor() {
        super();

        var graphic = new eg.Graphics.Circle(0, 0, 30, "red"),
            tween = new eg.Tweening.ColorTween(graphic.Color, eg.Graphics.Color.Blue, eg.TimeSpan.FromSeconds(1), eg.Tweening.Functions.Linear.EaseNone);

        tween.OnChange.Bind((newColor: eg.Graphics.Color) => {
            graphic.Color = newColor;
        });

        tween.Play();

        this.Scene.Add(graphic);

        this._tween = tween;
    }

    public Update(gameTime: eg.GameTime): void {
        this._tween.Update(gameTime);
    }
}

Usage:  

class MyGame extends eg.Game {
    constructor() {
        super();
    }

    public LoadContent(): void {
        // This assumes "mapJson" is set to your maps JSON data.
        eg.MapLoaders.JSONLoader.Load(mapJson, (result: eg.MapLoaders.IMapLoadedResult) => {
            // Triggered when the map has finished loading
            for(var i = 0; i < result.Layers.length; i++) {
                this.Scene.Add(result.Layers[i]);
            }
        };
    }
}

  • The CollisionManager has been highly optimized. It now uses a dynamically re-sizing quad tree for speedy collision checks. This also involved adding a new parameter to the CollisionManager's Monitor method to indicate if a Collidable is static or not. If a Collidable is static it means that it will not move throughout its life time and it cannot collide with other static objects (since they don't move). #6
class Rock extends Collidable {
    constructor() {
        super(new eg.Bounds.BoundingCircle(eg.Vector2d.Zero, 10));
    }
}

class MyGame extends eg.Game {
    constructor() {
        super();

        /*
        * To further optimize the QuadTree you can change the games collision configuration
        * Aka: this.Configuration.CollisionConfiguration.MinQuadTreeNodeSize and this.Configuration.CollisionConfiguration.InitialQuadTreeSize
        */

        // Monitor ...
Read more

0.1.1

14 Jul 21:49
Compare
Choose a tag to compare

Release Notes

This release is primarily for bug fixes that were overlooked during the 0.1.0 release.

Bugs

  • Child elements of graphics do not obey the Visible property. Issue.
  • Tweens should trigger OnChange when OnComplete triggers. Issue.
  • TimeSpan minutes returns the seconds value instead. Fix contributed by https://github.com/BorisKozo. Issue.
  • Game Dispose does not clean up the Map Scenery canvas. Issue.
  • Text2d bounds aren't calculated correctly when font size is set. Issue.