Skip to content

NTaylorMullen/EndGate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

EndGate

EndGate is a TypeScript powered game framework which was created for the sole purpose of making HTML5 game development maintainable, fun and easy.

Resources to get started

For all this and more you can always visit the EndGate homepage.

A brief look

1. Create a custom game object.

class MyGame extends eg.Game {
	constructor() {
		// Calling the super constructor without a canvas results in a full screen game.
		super();
	}
}

2. Add a rectangle member to MyGame (add to top of MyGame class).

private _rectangle: eg.Graphics.Rectangle;

3. Add the rectangle to the screen (add code inside the MyGame constructor).

// Create a green rectangle at (300, 250) with size (100, 75).
this._rectangle = new eg.Graphics.Rectangle(300, 250, 100, 75, "green");
// Add it to the screen
game.Scene.Add(this._rectangle);

4. Spin the rectangle forever (add method to MyGame).

public Update(gameTime: eg.GameTime): void {
	// Rotate the rectangle all the way around (clock-wise) every 1 second.
	this._rectangle.Rotation += (Math.PI * 2) * gameTime.Elapsed.Seconds;
}

5. Initialize the game (add code outside of the MyGame class).

var game = new MyGame();

Using EndGate in your project

  • Ensure you have AT LEAST TypeScript 0.9.0.1, you can get latest here
  • Get EndGate directly or via nuget. More details here
  • Add EndGate JavaScript to your web page:
<script src="Scripts/endgate-0.2.0.min.js" />
  • Reference the EndGate declaration file in your TypeScript files for typing:
/// <reference path="Scripts/endgate-0.2.0.d.ts" />

Building source requirements

Contributing

EndGate was built with the intent of providing room to have many contributions. With this goal in mind I have created base classes for much of the EndGate framework which can be derived from to create new and exciting features.

If you're looking to contribute to EndGate feel free to comment on an existing Issue (if you'd like to contribute the work for it) OR create a new issue with your suggested contribution.

Looking to contribute but need a few ideas?

Here's a few (absolutely not limited to):

  1. Graphic2ds: EndGate currently supports several shapes and lines but more shapes could be created. A polygon and triangle are two shapes that come to mind (but of course not limited to).
  2. MovementControllers: Currently there's only one MovementController, the LinearMovementController. There are an endless amount of MovementControllers that could be created.
  3. InputControllers: Currently there's only one InputController, the DirectionalInputController. There are an endless amount of InputControllers that could be created.
  4. Bounds2ds: There are only two types of Bounds currently in the EndGate framework, a Circle and a Rectangle bound. These could be expanded upon greatly.
  5. Tweens/TweeningFunctions: There are a significant amount of tweens already in the EndGate framework, however, there are an endless amount of tweens that could be craeted.