Skip to content

Commit

Permalink
Merged N+ physics in and tidied up the Docs folder and logos.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Aug 11, 2013
1 parent aff7d99 commit c2d7fb7
Show file tree
Hide file tree
Showing 108 changed files with 17,953 additions and 2,070 deletions.
File renamed without changes
Binary file added Docs/Phaser Logo/PNG/Phaser Logo Web Quality.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/Phaser Logo/PNG/Phaser-Logo-Small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added Docs/Phaser Logo/Pixel Art/Phaser-Logo-Sizes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
Binary file removed Docs/Phaser Logo/phaserSprite.gif
Binary file not shown.
4 changes: 0 additions & 4 deletions Phaser/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,6 @@ var Phaser;
}
};

Game.prototype.emptyCallback = function () {
// Called by onUpdateCallback etc
};

/**
* Game loop method will be called when it's running.
*/
Expand Down
123 changes: 118 additions & 5 deletions Phaser/Phaser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ProjectGuid>{A90BE60F-CAEA-4747-904A-CDB097BA2459}</ProjectGuid>
<ProjectGuid>{BB30C59B-5B34-4F7C-B5CC-8D49EA280EDA}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<OutputPath>bin</OutputPath>
Expand All @@ -17,6 +17,122 @@
</PropertyGroup>
<ItemGroup>
<TypeScriptCompile Include="utils\CanvasUtils.ts" />
<TypeScriptCompile Include="particles\ParticlePool.ts" />
<TypeScriptCompile Include="particles\ParticleManager.ts" />
<TypeScriptCompile Include="particles\initialize\Mass.ts" />
<TypeScriptCompile Include="particles\initialize\Initialize.ts" />
<TypeScriptCompile Include="particles\behaviours\Behaviour.ts" />
<Content Include="particles\behaviours\Behaviour.js">
<DependentUpon>Behaviour.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\behaviours\RandomDrift.ts" />
<Content Include="particles\behaviours\RandomDrift.js">
<DependentUpon>RandomDrift.ts</DependentUpon>
</Content>
<Content Include="particles\initialize\Initialize.js">
<DependentUpon>Initialize.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\initialize\Life.ts" />
<Content Include="particles\initialize\Life.js">
<DependentUpon>Life.ts</DependentUpon>
</Content>
<Content Include="particles\initialize\Mass.js">
<DependentUpon>Mass.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\initialize\Radius.ts" />
<TypeScriptCompile Include="particles\initialize\Position.ts" />
<Content Include="particles\initialize\Position.js">
<DependentUpon>Position.ts</DependentUpon>
</Content>
<Content Include="particles\initialize\Radius.js">
<DependentUpon>Radius.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\initialize\Rate.ts" />
<Content Include="particles\initialize\Rate.js">
<DependentUpon>Rate.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\initialize\Velocity.ts" />
<Content Include="particles\initialize\Velocity.js">
<DependentUpon>Velocity.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\NumericalIntegration.ts" />
<Content Include="particles\NumericalIntegration.js">
<DependentUpon>NumericalIntegration.ts</DependentUpon>
</Content>
<Content Include="particles\ParticleManager.js">
<DependentUpon>ParticleManager.ts</DependentUpon>
</Content>
<Content Include="particles\ParticlePool.js">
<DependentUpon>ParticlePool.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\ParticleUtils.ts" />
<Content Include="particles\ParticleUtils.js">
<DependentUpon>ParticleUtils.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\Span.ts" />
<TypeScriptCompile Include="particles\Polar2D.ts" />
<Content Include="particles\Polar2D.js">
<DependentUpon>Polar2D.ts</DependentUpon>
</Content>
<Content Include="particles\Span.js">
<DependentUpon>Span.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="particles\zone\Zone.ts" />
<TypeScriptCompile Include="particles\zone\PointZone.ts" />
<Content Include="particles\zone\PointZone.js">
<DependentUpon>PointZone.ts</DependentUpon>
</Content>
<Content Include="particles\zone\Zone.js">
<DependentUpon>Zone.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\PhysicsManager.ts" />
<TypeScriptCompile Include="physics\AABB.ts" />
<Content Include="physics\AABB.js">
<DependentUpon>AABB.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\Circle.ts" />
<TypeScriptCompile Include="physics\aabb\ProjAABBFull.ts" />
<TypeScriptCompile Include="physics\aabb\ProjAABBConvex.ts" />
<TypeScriptCompile Include="physics\aabb\ProjAABBConcave.ts" />
<Content Include="physics\aabb\ProjAABBConcave.js">
<DependentUpon>ProjAABBConcave.ts</DependentUpon>
</Content>
<Content Include="physics\aabb\ProjAABBConvex.js">
<DependentUpon>ProjAABBConvex.ts</DependentUpon>
</Content>
<Content Include="physics\aabb\ProjAABBFull.js">
<DependentUpon>ProjAABBFull.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\Body.ts" />
<Content Include="physics\Body.js">
<DependentUpon>Body.ts</DependentUpon>
</Content>
<Content Include="physics\Circle.js">
<DependentUpon>Circle.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\circle\ProjCircleFull.ts" />
<TypeScriptCompile Include="physics\circle\ProjCircle45Deg.ts" />
<Content Include="physics\circle\ProjCircle45Deg.js">
<DependentUpon>ProjCircle45Deg.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\circle\ProjCircleConcave.ts" />
<Content Include="physics\circle\ProjCircleConcave.js">
<DependentUpon>ProjCircleConcave.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\circle\ProjCircleConvex.ts" />
<Content Include="physics\circle\ProjCircleConvex.js">
<DependentUpon>ProjCircleConvex.ts</DependentUpon>
</Content>
<Content Include="physics\circle\ProjCircleFull.js">
<DependentUpon>ProjCircleFull.ts</DependentUpon>
</Content>
<Content Include="physics\PhysicsManager.js">
<DependentUpon>PhysicsManager.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\TileMapCell.ts" />
<Content Include="physics\TileMapCell.js">
<DependentUpon>TileMapCell.ts</DependentUpon>
</Content>
<Content Include="utils\CanvasUtils.js">
<DependentUpon>CanvasUtils.ts</DependentUpon>
</Content>
Expand Down Expand Up @@ -285,10 +401,6 @@
<Content Include="tilemap\TilemapLayer.js">
<DependentUpon>TilemapLayer.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="physics\arcade\Body.ts" />
<Content Include="physics\arcade\Body.js">
<DependentUpon>Body.ts</DependentUpon>
</Content>
<TypeScriptCompile Include="gameobjects\Events.ts" />
<Content Include="gameobjects\Events.js">
<DependentUpon>Events.ts</DependentUpon>
Expand Down Expand Up @@ -398,6 +510,7 @@
<DependentUpon>Game.ts</DependentUpon>
</Content>
</ItemGroup>
<ItemGroup />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
34 changes: 32 additions & 2 deletions Phaser/_definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
/// <reference path="tilemap/Tilemap.ts" />
/// <reference path="tilemap/TilemapLayer.ts" />

/// <reference path="physics/arcade/Body.ts" />

/// <reference path="gameobjects/Events.ts" />
/// <reference path="gameobjects/Sprite.ts" />
/// <reference path="gameobjects/TransformManager.ts" />
Expand Down Expand Up @@ -111,6 +109,38 @@
/// <reference path="renderers/canvas/TilemapRenderer.ts" />
/// <reference path="renderers/canvas/CanvasRenderer.ts" />

/// <reference path="physics/PhysicsManager.ts" />
/// <reference path="physics/Body.ts" />
/// <reference path="physics/AABB.ts" />
/// <reference path="physics/Circle.ts" />
/// <reference path="physics/TileMapCell.ts" />
/// <reference path="physics/aabb/ProjAABBFull.ts" />
/// <reference path="physics/aabb/ProjAABBConvex.ts" />
/// <reference path="physics/aabb/ProjAABBConcave.ts" />
/// <reference path="physics/circle/ProjCircleFull.ts" />
/// <reference path="physics/circle/ProjCircleConvex.ts" />
/// <reference path="physics/circle/ProjCircleConcave.ts" />
/// <reference path="physics/circle/ProjCircle45Deg.ts" />

/// <reference path="particles/ParticleManager.ts" />
/// <reference path="particles/Particle.ts" />
/// <reference path="particles/Emitter.ts" />
/// <reference path="particles/ParticlePool.ts" />
/// <reference path="particles/ParticleUtils.ts" />
/// <reference path="particles/Polar2D.ts" />
/// <reference path="particles/Span.ts" />
/// <reference path="particles/NumericalIntegration.ts" />
/// <reference path="particles/behaviours/Behaviour.ts" />
/// <reference path="particles/behaviours/RandomDrift.ts" />
/// <reference path="particles/initialize/Initialize.ts" />
/// <reference path="particles/initialize/Life.ts" />
/// <reference path="particles/initialize/Mass.ts" />
/// <reference path="particles/initialize/Position.ts" />
/// <reference path="particles/initialize/Rate.ts" />
/// <reference path="particles/initialize/Velocity.ts" />
/// <reference path="particles/zone/Zone.ts" />
/// <reference path="particles/zone/PointZone.ts" />

/// <reference path="World.ts" />
/// <reference path="Stage.ts" />
/// <reference path="State.ts" />
Expand Down
5 changes: 4 additions & 1 deletion Phaser/core/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var Phaser;
this.modified = false;
this.game = game;
this.type = Phaser.Types.GROUP;
this.active = true;
this.exists = true;
this.visible = true;

Expand Down Expand Up @@ -95,7 +96,9 @@ var Phaser;
this._member = this.members[this._i++];

if (this._member != null && this._member.exists && this._member.active) {
this._member.preUpdate();
if (this._member.type != Phaser.Types.GROUP) {
this._member.preUpdate();
}
this._member.update();
}
}
Expand Down
37 changes: 22 additions & 15 deletions Phaser/gameobjects/GameObjectFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ var Phaser;
return this.game.sound.add(key, volume, loop);
};

GameObjectFactory.prototype.circle = function (x, y, radius) {
return new Phaser.Physics.Circle(this.game, x, y, radius);
};

GameObjectFactory.prototype.aabb = function (x, y, width, height) {
return new Phaser.Physics.AABB(this.game, x, y, Math.floor(width / 2), Math.floor(height / 2));
};

GameObjectFactory.prototype.cell = function (x, y, width, height, state) {
if (typeof state === "undefined") { state = Phaser.Physics.TileMapCell.TID_FULL; }
return new Phaser.Physics.TileMapCell(this.game, x, y, width, height).SetState(state);
};

/**
* Create a new Sprite with the physics automatically created and set to DYNAMIC. The Sprite position offset is set to its center.
*
Expand Down Expand Up @@ -125,10 +138,9 @@ var Phaser;
*
* @return {Particle} The newly created particle object.
*/
GameObjectFactory.prototype.particle = function () {
return new Phaser.ArcadeParticle(this.game);
};

//public particle(): Phaser.ArcadeParticle {
// return new Phaser.ArcadeParticle(this.game);
//}
/**
* Create a new Emitter.
*
Expand All @@ -137,13 +149,9 @@ var Phaser;
* @param size {number} Optional, size of this emitter.
* @return {Emitter} The newly created emitter object.
*/
GameObjectFactory.prototype.emitter = function (x, y, size) {
if (typeof x === "undefined") { x = 0; }
if (typeof y === "undefined") { y = 0; }
if (typeof size === "undefined") { size = 0; }
return this._world.group.add(new Phaser.ArcadeEmitter(this.game, x, y, size));
};

//public emitter(x: number = 0, y: number = 0, size: number = 0): Phaser.ArcadeEmitter {
// return <Phaser.ArcadeEmitter> this._world.group.add(new Phaser.ArcadeEmitter(this.game, x, y, size));
//}
/**
* Create a new ScrollZone object with image key, position and size.
*
Expand Down Expand Up @@ -242,10 +250,9 @@ var Phaser;
* @param emitter The Emitter to add to the Game World
* @return {Phaser.Emitter} The Emitter object
*/
GameObjectFactory.prototype.existingEmitter = function (emitter) {
return this._world.group.add(emitter);
};

//public existingEmitter(emitter: Phaser.ArcadeEmitter): Phaser.ArcadeEmitter {
// return this._world.group.add(emitter);
//}
/**
* Add an existing ScrollZone to the current world.
* Note: This doesn't check or update the objects reference to Game. If that is wrong, all kinds of things will break.
Expand Down
30 changes: 21 additions & 9 deletions Phaser/gameobjects/GameObjectFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ module Phaser {
return <Phaser.Sound> this.game.sound.add(key, volume, loop);
}

public circle(x: number, y: number, radius: number): Phaser.Physics.Circle {
return new Phaser.Physics.Circle(this.game, x, y, radius);
}

public aabb(x: number, y: number, width: number, height:number): Phaser.Physics.AABB {
return new Phaser.Physics.AABB(this.game, x, y, Math.floor(width / 2), Math.floor(height / 2));
}

public cell(x: number, y: number, width: number, height: number, state: number = Phaser.Physics.TileMapCell.TID_FULL): Phaser.Physics.TileMapCell {
return new Phaser.Physics.TileMapCell(this.game, x, y, width, height).SetState(state);
}

/**
* Create a new Sprite with the physics automatically created and set to DYNAMIC. The Sprite position offset is set to its center.
*
Expand Down Expand Up @@ -130,9 +142,9 @@ module Phaser {
*
* @return {Particle} The newly created particle object.
*/
public particle(): Phaser.ArcadeParticle {
return new Phaser.ArcadeParticle(this.game);
}
//public particle(): Phaser.ArcadeParticle {
// return new Phaser.ArcadeParticle(this.game);
//}

/**
* Create a new Emitter.
Expand All @@ -142,9 +154,9 @@ module Phaser {
* @param size {number} Optional, size of this emitter.
* @return {Emitter} The newly created emitter object.
*/
public emitter(x: number = 0, y: number = 0, size: number = 0): Phaser.ArcadeEmitter {
return <Phaser.ArcadeEmitter> this._world.group.add(new Phaser.ArcadeEmitter(this.game, x, y, size));
}
//public emitter(x: number = 0, y: number = 0, size: number = 0): Phaser.ArcadeEmitter {
// return <Phaser.ArcadeEmitter> this._world.group.add(new Phaser.ArcadeEmitter(this.game, x, y, size));
//}

/**
* Create a new ScrollZone object with image key, position and size.
Expand Down Expand Up @@ -237,9 +249,9 @@ module Phaser {
* @param emitter The Emitter to add to the Game World
* @return {Phaser.Emitter} The Emitter object
*/
public existingEmitter(emitter: Phaser.ArcadeEmitter): Phaser.ArcadeEmitter {
return this._world.group.add(emitter);
}
//public existingEmitter(emitter: Phaser.ArcadeEmitter): Phaser.ArcadeEmitter {
// return this._world.group.add(emitter);
//}

/**
* Add an existing ScrollZone to the current world.
Expand Down
Loading

0 comments on commit c2d7fb7

Please sign in to comment.