Refactoring of the codebase finished. All classes updated. Ready for final push to 1.0 release.

This commit is contained in:
Richard Davey 2013-04-18 15:48:06 +01:00
parent 6bb4c5e3fc
commit 64d57b8e05
109 changed files with 3458 additions and 3227 deletions

BIN
Docs/phaser_balls.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
Docs/phaser_cams.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
Docs/phaser_particles.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

BIN
Docs/phaser_tilemap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -7,7 +7,7 @@
module Phaser {
export class Animations {
export class AnimationManager {
constructor(game: Game, parent: Sprite) {

View file

@ -56,17 +56,17 @@ module Phaser {
public isGroup: bool;
/**
* Controls whether <code>update()</code> and <code>draw()</code> are automatically called by FlxState/FlxGroup.
* Controls whether <code>update()</code> and <code>draw()</code> are automatically called by State/Group.
*/
public exists: bool;
/**
* Controls whether <code>update()</code> is automatically called by FlxState/FlxGroup.
* Controls whether <code>update()</code> is automatically called by State/Group.
*/
public active: bool;
/**
* Controls whether <code>draw()</code> is automatically called by FlxState/FlxGroup.
* Controls whether <code>draw()</code> is automatically called by State/Group.
*/
public visible: bool;
@ -125,7 +125,7 @@ module Phaser {
/**
* Handy for bringing game objects "back to life". Just sets alive and exists back to true.
* In practice, this is most often called by <code>FlxObject.reset()</code>.
* In practice, this is most often called by <code>Object.reset()</code>.
*/
public revive() {
this.alive = true;

View file

@ -10,7 +10,7 @@
module Phaser {
export class Cameras {
export class CameraManager {
constructor(game: Game, x: number, y: number, width: number, height: number) {

View file

@ -1,7 +1,7 @@
/// <reference path="Animations.ts" />
/// <reference path="AnimationManager.ts" />
/// <reference path="Basic.ts" />
/// <reference path="Cache.ts" />
/// <reference path="Cameras.ts" />
/// <reference path="CameraManager.ts" />
/// <reference path="Collision.ts" />
/// <reference path="DynamicTexture.ts" />
/// <reference path="GameMath.ts" />

View file

@ -858,8 +858,8 @@ module Phaser {
/**
* Fetch a random entry from the given array.
* Will return null if random selection is missing, or array has no entries.
* <code>FlxG.getRandom()</code> is deterministic and safe for use with replays/recordings.
* HOWEVER, <code>FlxU.getRandom()</code> is NOT deterministic and unsafe for use with replays/recordings.
* <code>G.getRandom()</code> is deterministic and safe for use with replays/recordings.
* HOWEVER, <code>U.getRandom()</code> is NOT deterministic and unsafe for use with replays/recordings.
*
* @param Objects An array of objects.
* @param StartIndex Optional offset off the front of the array. Default value is 0, or the beginning of the array.

View file

@ -60,7 +60,7 @@ module Phaser {
private _maxSize: number;
/**
* Internal helper variable for recycling objects a la <code>FlxEmitter</code>.
* Internal helper variable for recycling objects a la <code>Emitter</code>.
*/
private _marker: number;
@ -185,7 +185,7 @@ module Phaser {
}
/**
* Adds a new <code>Basic</code> subclass (Basic, FlxBasic, Enemy, etc) to the group.
* Adds a new <code>Basic</code> subclass (Basic, Basic, Enemy, etc) to the group.
* Group will try to replace a null member of the array first.
* Failing that, Group will add it to the end of the member array,
* assuming there is room for it, and doubling the size of the array if necessary.
@ -275,7 +275,7 @@ module Phaser {
* and no object class was provided, it will return null
* instead of a valid object!</p>
*
* @param ObjectClass The class type you want to recycle (e.g. FlxBasic, EvilRobot, etc). Do NOT "new" the class in the parameter!
* @param ObjectClass The class type you want to recycle (e.g. Basic, EvilRobot, etc). Do NOT "new" the class in the parameter!
*
* @return A reference to the object that was created. Don't forget to cast it back to the Class you want (e.g. myObject = myGroup.recycle(myObjectClass) as myObjectClass;).
*/
@ -382,7 +382,7 @@ module Phaser {
* Call this function to sort the group according to a particular value and order.
* For example, to sort game objects for Zelda-style overlaps you might call
* <code>myGroup.sort("y",Group.ASCENDING)</code> at the bottom of your
* <code>FlxState.update()</code> override. To sort all existing objects after
* <code>State.update()</code> override. To sort all existing objects after
* a big explosion or bomb attack, you might call <code>myGroup.sort("exists",Group.DESCENDING)</code>.
*
* @param Index The <code>string</code> name of the member variable you want to sort on. Default value is "y".
@ -696,7 +696,7 @@ module Phaser {
}
/**
* Remove all instances of <code>Basic</code> subclass (FlxBasic, FlxBlock, etc) from the list.
* Remove all instances of <code>Basic</code> subclass (Basic, Block, etc) from the list.
* WARNING: does not destroy() or kill() any of these objects!
*/
public clear() {

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -55,70 +55,253 @@
<TypeScriptOutFile>../build/phaser.js</TypeScriptOutFile>
</PropertyGroup>
<ItemGroup>
<TypeScriptCompile Include="Phaser.ts" />
<TypeScriptCompile Include="Animations.ts" />
<TypeScriptCompile Include="Basic.ts" />
<TypeScriptCompile Include="Cache.ts" />
<TypeScriptCompile Include="Cameras.ts" />
<TypeScriptCompile Include="gameobjects\Emitter.ts" />
<TypeScriptCompile Include="Game.ts" />
<TypeScriptCompile Include="GameMath.ts" />
<TypeScriptCompile Include="gameobjects\GameObject.ts" />
<TypeScriptCompile Include="Group.ts" />
<TypeScriptCompile Include="Loader.ts" />
<TypeScriptCompile Include="gameobjects\Particle.ts" />
<TypeScriptCompile Include="geom\Circle.ts" />
<TypeScriptCompile Include="geom\Point.ts" />
<TypeScriptCompile Include="geom\Rectangle.ts" />
<TypeScriptCompile Include="Sound.ts" />
<TypeScriptCompile Include="gameobjects\Sprite.ts" />
<TypeScriptCompile Include="Stage.ts" />
<TypeScriptCompile Include="State.ts" />
<TypeScriptCompile Include="Signal.ts" />
<TypeScriptCompile Include="SignalBinding.ts" />
<TypeScriptCompile Include="system\animation\Animation.ts" />
<TypeScriptCompile Include="system\animation\AnimationLoader.ts" />
<TypeScriptCompile Include="system\animation\Frame.ts" />
<TypeScriptCompile Include="system\animation\FrameData.ts" />
<TypeScriptCompile Include="system\Camera.ts" />
<TypeScriptCompile Include="system\Device.ts" />
<TypeScriptCompile Include="system\input\Finger.ts" />
<TypeScriptCompile Include="system\input\Input.ts" />
<TypeScriptCompile Include="system\input\Keyboard.ts" />
<TypeScriptCompile Include="system\input\Mouse.ts" />
<TypeScriptCompile Include="system\input\Touch.ts" />
<TypeScriptCompile Include="system\LinkedList.ts" />
<TypeScriptCompile Include="system\QuadTree.ts" />
<TypeScriptCompile Include="system\RandomDataGenerator.ts" />
<TypeScriptCompile Include="system\RequestAnimationFrame.ts" />
<TypeScriptCompile Include="system\StageScaleMode.ts" />
<TypeScriptCompile Include="system\Tile.ts" />
<TypeScriptCompile Include="system\TilemapBuffer.ts" />
<TypeScriptCompile Include="gameobjects\Tilemap.ts" />
<TypeScriptCompile Include="Time.ts" />
<TypeScriptCompile Include="World.ts" />
<TypeScriptCompile Include="DynamicTexture.ts" />
<TypeScriptCompile Include="Collision.ts" />
<TypeScriptCompile Include="system\Tween.ts" />
<TypeScriptCompile Include="geom\Line.ts" />
<TypeScriptCompile Include="gameobjects\GeomSprite.ts" />
<TypeScriptCompile Include="geom\IntersectResult.ts" />
<TypeScriptCompile Include="Motion.ts" />
<TypeScriptCompile Include="TweenManager.ts" />
<TypeScriptCompile Include="system\easing\Back.ts" />
<TypeScriptCompile Include="system\easing\Bounce.ts" />
<TypeScriptCompile Include="system\easing\Circular.ts" />
<TypeScriptCompile Include="system\easing\Cubic.ts" />
<TypeScriptCompile Include="system\easing\Elastic.ts" />
<TypeScriptCompile Include="system\easing\Exponential.ts" />
<TypeScriptCompile Include="system\easing\Linear.ts" />
<TypeScriptCompile Include="system\easing\Quadratic.ts" />
<TypeScriptCompile Include="system\easing\Quartic.ts" />
<TypeScriptCompile Include="system\easing\Quintic.ts" />
<TypeScriptCompile Include="system\easing\Sinusoidal.ts" />
<Folder Include="plugins\" />
</ItemGroup>
<ItemGroup>
<Folder Include="plugins\" />
<Content Include="AnimationManager.js">
<DependentUpon>AnimationManager.ts</DependentUpon>
</Content>
<Content Include="Collision.js">
<DependentUpon>Collision.ts</DependentUpon>
</Content>
<Content Include="DynamicTexture.js">
<DependentUpon>DynamicTexture.ts</DependentUpon>
</Content>
<Content Include="Game.js">
<DependentUpon>Game.ts</DependentUpon>
</Content>
<Content Include="GameMath.js">
<DependentUpon>GameMath.ts</DependentUpon>
</Content>
<Content Include="gameobjects\Emitter.js">
<DependentUpon>Emitter.ts</DependentUpon>
</Content>
<Content Include="gameobjects\GameObject.js">
<DependentUpon>GameObject.ts</DependentUpon>
</Content>
<Content Include="gameobjects\GeomSprite.js">
<DependentUpon>GeomSprite.ts</DependentUpon>
</Content>
<Content Include="gameobjects\Particle.js">
<DependentUpon>Particle.ts</DependentUpon>
</Content>
<Content Include="gameobjects\Sprite.js">
<DependentUpon>Sprite.ts</DependentUpon>
</Content>
<Content Include="gameobjects\Tilemap.js">
<DependentUpon>Tilemap.ts</DependentUpon>
</Content>
<Content Include="geom\Circle.js">
<DependentUpon>Circle.ts</DependentUpon>
</Content>
<Content Include="geom\IntersectResult.js">
<DependentUpon>IntersectResult.ts</DependentUpon>
</Content>
<Content Include="geom\Line.js">
<DependentUpon>Line.ts</DependentUpon>
</Content>
<Content Include="geom\Point.js">
<DependentUpon>Point.ts</DependentUpon>
</Content>
<Content Include="geom\Rectangle.js">
<DependentUpon>Rectangle.ts</DependentUpon>
</Content>
<Content Include="system\animation\Animation.js">
<DependentUpon>Animation.ts</DependentUpon>
</Content>
<Content Include="system\animation\AnimationLoader.js">
<DependentUpon>AnimationLoader.ts</DependentUpon>
</Content>
<Content Include="system\animation\Frame.js">
<DependentUpon>Frame.ts</DependentUpon>
</Content>
<Content Include="system\animation\FrameData.js">
<DependentUpon>FrameData.ts</DependentUpon>
</Content>
<Content Include="system\Camera.js">
<DependentUpon>Camera.ts</DependentUpon>
</Content>
<Content Include="system\Device.js">
<DependentUpon>Device.ts</DependentUpon>
</Content>
<Content Include="system\LinkedList.js">
<DependentUpon>LinkedList.ts</DependentUpon>
</Content>
<Content Include="system\QuadTree.js">
<DependentUpon>QuadTree.ts</DependentUpon>
</Content>
<Content Include="system\RandomDataGenerator.js">
<DependentUpon>RandomDataGenerator.ts</DependentUpon>
</Content>
<Content Include="system\RequestAnimationFrame.js">
<DependentUpon>RequestAnimationFrame.ts</DependentUpon>
</Content>
<Content Include="system\StageScaleMode.js">
<DependentUpon>StageScaleMode.ts</DependentUpon>
</Content>
<Content Include="system\Tile.js">
<DependentUpon>Tile.ts</DependentUpon>
</Content>
<Content Include="system\TilemapBuffer.js">
<DependentUpon>TilemapBuffer.ts</DependentUpon>
</Content>
<Content Include="system\Tween.js">
<DependentUpon>Tween.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="system\Tween.ts" />
<TypeScriptCompile Include="system\TilemapBuffer.ts" />
<TypeScriptCompile Include="system\Tile.ts" />
<TypeScriptCompile Include="system\StageScaleMode.ts" />
<TypeScriptCompile Include="system\RequestAnimationFrame.ts" />
<TypeScriptCompile Include="system\RandomDataGenerator.ts" />
<TypeScriptCompile Include="system\QuadTree.ts" />
<TypeScriptCompile Include="system\LinkedList.ts" />
<TypeScriptCompile Include="system\Device.ts" />
<TypeScriptCompile Include="system\Camera.ts" />
<Content Include="system\easing\Back.js">
<DependentUpon>Back.ts</DependentUpon>
</Content>
<Content Include="system\easing\Bounce.js">
<DependentUpon>Bounce.ts</DependentUpon>
</Content>
<Content Include="system\easing\Circular.js">
<DependentUpon>Circular.ts</DependentUpon>
</Content>
<Content Include="system\easing\Cubic.js">
<DependentUpon>Cubic.ts</DependentUpon>
</Content>
<Content Include="system\easing\Elastic.js">
<DependentUpon>Elastic.ts</DependentUpon>
</Content>
<Content Include="system\easing\Exponential.js">
<DependentUpon>Exponential.ts</DependentUpon>
</Content>
<Content Include="system\easing\Linear.js">
<DependentUpon>Linear.ts</DependentUpon>
</Content>
<Content Include="system\easing\Quadratic.js">
<DependentUpon>Quadratic.ts</DependentUpon>
</Content>
<Content Include="system\easing\Quartic.js">
<DependentUpon>Quartic.ts</DependentUpon>
</Content>
<Content Include="system\easing\Quintic.js">
<DependentUpon>Quintic.ts</DependentUpon>
</Content>
<Content Include="system\easing\Sinusoidal.js">
<DependentUpon>Sinusoidal.ts</DependentUpon>
</Content>
<Content Include="system\input\Finger.js">
<DependentUpon>Finger.ts</DependentUpon>
</Content>
<Content Include="system\input\Input.js">
<DependentUpon>Input.ts</DependentUpon>
</Content>
<Content Include="system\input\Keyboard.js">
<DependentUpon>Keyboard.ts</DependentUpon>
</Content>
<Content Include="system\input\Mouse.js">
<DependentUpon>Mouse.ts</DependentUpon>
</Content>
<Content Include="system\input\Touch.js">
<DependentUpon>Touch.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="system\input\Touch.ts" />
<TypeScriptCompile Include="system\input\Mouse.ts" />
<TypeScriptCompile Include="system\input\Keyboard.ts" />
<TypeScriptCompile Include="system\input\Input.ts" />
<TypeScriptCompile Include="system\input\Finger.ts" />
<TypeScriptCompile Include="system\easing\Sinusoidal.ts" />
<TypeScriptCompile Include="system\easing\Quintic.ts" />
<TypeScriptCompile Include="system\easing\Quartic.ts" />
<TypeScriptCompile Include="system\easing\Quadratic.ts" />
<TypeScriptCompile Include="system\easing\Linear.ts" />
<TypeScriptCompile Include="system\easing\Exponential.ts" />
<TypeScriptCompile Include="system\easing\Elastic.ts" />
<TypeScriptCompile Include="system\easing\Cubic.ts" />
<TypeScriptCompile Include="system\easing\Circular.ts" />
<TypeScriptCompile Include="system\easing\Bounce.ts" />
<TypeScriptCompile Include="system\easing\Back.ts" />
<TypeScriptCompile Include="system\animation\FrameData.ts" />
<TypeScriptCompile Include="system\animation\Frame.ts" />
<TypeScriptCompile Include="system\animation\AnimationLoader.ts" />
<TypeScriptCompile Include="system\animation\Animation.ts" />
<TypeScriptCompile Include="geom\Rectangle.ts" />
<TypeScriptCompile Include="geom\Point.ts" />
<TypeScriptCompile Include="geom\Line.ts" />
<TypeScriptCompile Include="geom\IntersectResult.ts" />
<TypeScriptCompile Include="geom\Circle.ts" />
<TypeScriptCompile Include="gameobjects\Tilemap.ts" />
<TypeScriptCompile Include="gameobjects\Sprite.ts" />
<TypeScriptCompile Include="gameobjects\Particle.ts" />
<TypeScriptCompile Include="gameobjects\GeomSprite.ts" />
<TypeScriptCompile Include="gameobjects\GameObject.ts" />
<TypeScriptCompile Include="gameobjects\Emitter.ts" />
<Content Include="Group.js">
<DependentUpon>Group.ts</DependentUpon>
</Content>
<Content Include="Loader.js">
<DependentUpon>Loader.ts</DependentUpon>
</Content>
<Content Include="Motion.js">
<DependentUpon>Motion.ts</DependentUpon>
</Content>
<Content Include="Phaser.js">
<DependentUpon>Phaser.ts</DependentUpon>
</Content>
<Content Include="Signal.js">
<DependentUpon>Signal.ts</DependentUpon>
</Content>
<Content Include="SignalBinding.js">
<DependentUpon>SignalBinding.ts</DependentUpon>
</Content>
<Content Include="Sound.js">
<DependentUpon>Sound.ts</DependentUpon>
</Content>
<Content Include="Stage.js">
<DependentUpon>Stage.ts</DependentUpon>
</Content>
<Content Include="State.js">
<DependentUpon>State.ts</DependentUpon>
</Content>
<Content Include="Time.js">
<DependentUpon>Time.ts</DependentUpon>
</Content>
<Content Include="TweenManager.js">
<DependentUpon>TweenManager.ts</DependentUpon>
</Content>
<Content Include="World.js">
<DependentUpon>World.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="World.ts" />
<TypeScriptCompile Include="TweenManager.ts" />
<TypeScriptCompile Include="Time.ts" />
<TypeScriptCompile Include="State.ts" />
<TypeScriptCompile Include="Stage.ts" />
<TypeScriptCompile Include="Sound.ts" />
<TypeScriptCompile Include="SignalBinding.ts" />
<TypeScriptCompile Include="Signal.ts" />
<TypeScriptCompile Include="Phaser.ts" />
<TypeScriptCompile Include="Motion.ts" />
<TypeScriptCompile Include="Loader.ts" />
<TypeScriptCompile Include="Group.ts" />
<TypeScriptCompile Include="GameMath.ts" />
<TypeScriptCompile Include="Game.ts" />
<TypeScriptCompile Include="DynamicTexture.ts" />
<TypeScriptCompile Include="Collision.ts" />
<TypeScriptCompile Include="AnimationManager.ts" />
<Content Include="Basic.js">
<DependentUpon>Basic.ts</DependentUpon>
</Content>
<Content Include="Cache.js">
<DependentUpon>Cache.ts</DependentUpon>
</Content>
<Content Include="CameraManager.js">
<DependentUpon>CameraManager.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="CameraManager.ts" />
<TypeScriptCompile Include="Cache.ts" />
<TypeScriptCompile Include="Basic.ts" />
</ItemGroup>
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
<PropertyGroup>

View file

@ -12,7 +12,7 @@ module Phaser {
this._game = game;
this._cameras = new Cameras(this._game, 0, 0, width, height);
this._cameras = new CameraManager(this._game, 0, 0, width, height);
this._game.camera = this._cameras.current;
@ -25,7 +25,7 @@ module Phaser {
}
private _game: Game;
private _cameras: Cameras;
private _cameras: CameraManager;
public group: Group;
public bounds: Rectangle;

View file

@ -24,7 +24,7 @@ module Phaser {
export class Emitter extends Group {
/**
* Creates a new <code>FlxEmitter</code> object at a specific position.
* Creates a new <code>Emitter</code> object at a specific position.
* Does NOT automatically generate or attach particles!
*
* @param X The X position of the emitter.
@ -176,13 +176,13 @@ module Phaser {
/**
* This function generates a new array of particle sprites to attach to the emitter.
*
* @param Graphics If you opted to not pre-configure an array of FlxSprite objects, you can simply pass in a particle image or sprite sheet.
* @param Graphics If you opted to not pre-configure an array of Sprite objects, you can simply pass in a particle image or sprite sheet.
* @param Quantity The number of particles to generate when using the "create from image" option.
* @param BakedRotations How many frames of baked rotation to use (boosts performance). Set to zero to not use baked rotations.
* @param Multiple Whether the image in the Graphics param is a single particle or a bunch of particles (if it's a bunch, they need to be square!).
* @param Collide Whether the particles should be flagged as not 'dead' (non-colliding particles are higher performance). 0 means no collisions, 0-1 controls scale of particle's bounding box.
*
* @return This FlxEmitter instance (nice for chaining stuff together, if you're into that).
* @return This Emitter instance (nice for chaining stuff together, if you're into that).
*/
public makeParticles(Graphics, Quantity: number = 50, BakedRotations: number = 16, Multiple: bool = false, Collide: number = 0.8): Emitter {
@ -447,9 +447,9 @@ module Phaser {
}
/**
* Change the emitter's midpoint to match the midpoint of a <code>FlxObject</code>.
* Change the emitter's midpoint to match the midpoint of a <code>Object</code>.
*
* @param Object The <code>FlxObject</code> that you want to sync up with.
* @param Object The <code>Object</code> that you want to sync up with.
*/
public at(Object) {
Object.getMidpoint(this._point);

View file

@ -1,5 +1,6 @@
/// <reference path="../Game.ts" />
/// <reference path="../Basic.ts" />
/// <reference path="../Signal.ts" />
/**
* Phaser
@ -80,6 +81,15 @@ module Phaser {
public allowCollisions: number;
public last: Point;
// Input
public inputEnabled: bool = false;
private _inputOver: bool = false;
public onInputOver: Phaser.Signal;
public onInputOut: Phaser.Signal;
public onInputDown: Phaser.Signal;
public onInputUp: Phaser.Signal;
public preUpdate() {
// flicker time
@ -99,9 +109,20 @@ module Phaser {
this.updateMotion();
}
if (this.inputEnabled)
{
this.updateInput();
}
this.wasTouching = this.touching;
this.touching = Collision.NONE;
}
private updateInput() {
}
private updateMotion() {
@ -129,8 +150,8 @@ module Phaser {
}
/**
* Checks to see if some <code>GameObject</code> overlaps this <code>GameObject</code> or <code>FlxGroup</code>.
* If the group has a LOT of things in it, it might be faster to use <code>FlxG.overlaps()</code>.
* Checks to see if some <code>GameObject</code> overlaps this <code>GameObject</code> or <code>Group</code>.
* If the group has a LOT of things in it, it might be faster to use <code>G.overlaps()</code>.
* WARNING: Currently tilemaps do NOT support screen space overlap checks!
*
* @param ObjectOrGroup The object or group being tested.
@ -160,7 +181,7 @@ module Phaser {
}
/*
if (typeof ObjectOrGroup === 'FlxTilemap')
if (typeof ObjectOrGroup === 'Tilemap')
{
//Since tilemap's have to be the caller, not the target, to do proper tile-based collisions,
// we redirect the call to the tilemap overlap here.
@ -190,7 +211,7 @@ module Phaser {
}
/**
* Checks to see if this <code>GameObject</code> were located at the given position, would it overlap the <code>GameObject</code> or <code>FlxGroup</code>?
* Checks to see if this <code>GameObject</code> were located at the given position, would it overlap the <code>GameObject</code> or <code>Group</code>?
* This is distinct from overlapsPoint(), which just checks that ponumber, rather than taking the object's size numbero account.
* WARNING: Currently tilemaps do NOT support screen space overlap checks!
*
@ -223,13 +244,13 @@ module Phaser {
}
/*
if (typeof ObjectOrGroup === 'FlxTilemap')
if (typeof ObjectOrGroup === 'Tilemap')
{
//Since tilemap's have to be the caller, not the target, to do proper tile-based collisions,
// we redirect the call to the tilemap overlap here.
//However, since this is overlapsAt(), we also have to invent the appropriate position for the tilemap.
//So we calculate the offset between the player and the requested position, and subtract that from the tilemap.
var tilemap: FlxTilemap = ObjectOrGroup;
var tilemap: Tilemap = ObjectOrGroup;
return tilemap.overlapsAt(tilemap.x - (X - this.x), tilemap.y - (Y - this.y), this, InScreenSpace, Camera);
}
*/

View file

@ -217,7 +217,7 @@ module Phaser {
this._dy -= (camera.worldView.y * this.scrollFactor.y);
}
// Rotation (misleading?)
// Rotation (could be misleading as it doesn't work re: collision)
if (this.angle !== 0)
{
this._game.stage.context.save();
@ -235,8 +235,8 @@ module Phaser {
this._game.stage.saveCanvasValues();
// Debug
this._game.stage.context.fillStyle = 'rgba(255,0,0,0.5)';
this._game.stage.context.fillRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height);
//this._game.stage.context.fillStyle = 'rgba(255,0,0,0.5)';
//this._game.stage.context.fillRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height);
this._game.stage.context.lineWidth = this.lineWidth;
this._game.stage.context.strokeStyle = this.lineColor;

View file

@ -1,4 +1,5 @@
/// <reference path="../Game.ts" />
/// <reference path="../AnimationManager.ts" />
/// <reference path="GameObject.ts" />
/**
@ -15,7 +16,7 @@ module Phaser {
this._texture = null;
this.animations = new Animations(this._game, this);
this.animations = new AnimationManager(this._game, this);
if (key !== null)
{
@ -34,7 +35,7 @@ module Phaser {
private _context: CanvasRenderingContext2D;
private _dynamicTexture: bool = false;
public animations: Animations;
public animations: AnimationManager;
// local rendering related temp vars to help avoid gc spikes
private _sx: number = 0;
@ -189,7 +190,8 @@ module Phaser {
if (this.angle !== 0)
{
this._game.stage.context.save();
this._game.stage.context.translate(this._dx + (this._dw / 2) - this.origin.x, this._dy + (this._dh / 2) - this.origin.y);
//this._game.stage.context.translate(this._dx + (this._dw / 2) - this.origin.x, this._dy + (this._dh / 2) - this.origin.y);
this._game.stage.context.translate(this._dx + (this._dw / 2), this._dy + (this._dh / 2));
this._game.stage.context.rotate(this.angle * (Math.PI / 180));
this._dx = -(this._dw / 2);
this._dy = -(this._dh / 2);

View file

@ -1,5 +1,5 @@
/// <reference path="../Game.ts" />
/// <reference path="../gameobjects/Sprite.ts" />
/// <reference path="../Game.ts" />
/**
* Phaser
@ -281,7 +281,7 @@ module Phaser {
this.bounds.setTo(X, Y, Width, Height);
//if(UpdateWorld)
// FlxG.worldBounds.copyFrom(bounds);
// G.worldBounds.copyFrom(bounds);
this.update();
}

View file

@ -18,7 +18,7 @@ module Phaser {
export class Tile extends GameObject {
/**
* Instantiate this new tile object. This is usually called from <code>FlxTilemap.loadMap()</code>.
* Instantiate this new tile object. This is usually called from <code>Tilemap.loadMap()</code>.
*
* @param Tilemap A reference to the tilemap object creating the tile.
* @param Index The actual core map data index for this tile type.
@ -47,8 +47,8 @@ module Phaser {
/**
* This function is called whenever an object hits a tile of this type.
* This function should take the form <code>myFunction(Tile:FlxTile,Object:FlxObject)</code>.
* Defaults to null, set through <code>FlxTilemap.setTileProperties()</code>.
* This function should take the form <code>myFunction(Tile:Tile,Object:Object)</code>.
* Defaults to null, set through <code>Tilemap.setTileProperties()</code>.
*/
public callback;
@ -56,7 +56,7 @@ module Phaser {
* Each tile can store its own filter class for their callback functions.
* That is, the callback will only be triggered if an object with a class
* type matching the filter touched it.
* Defaults to null, set through <code>FlxTilemap.setTileProperties()</code>.
* Defaults to null, set through <code>Tilemap.setTileProperties()</code>.
*/
public filter;

View file

@ -1,4 +1,5 @@
/// <reference path="../../Game.ts" />
/// <reference path="../../Signal.ts" />
/**
* Phaser

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);
var circle;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);
var line;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);
var floor;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);
var box1;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
// Here we create a quite tiny game (320x240 in size)
var myGame = new Phaser.Game(this, 'game', 320, 240, init, create, update);

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 840, 400, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
// Let's test having 2 totally separate games embedded on the same page
var myGame = new Phaser.Game(this, 'game', 400, 400, init, create, update);

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, null, create);
var emitter;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create);
var emitter;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
var emitter1;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
var leftEmitter;

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {

View file

@ -1,4 +1,4 @@
/// <reference path="../../Phaser/Phaser.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {

Some files were not shown because too many files have changed in this diff Show more