Skip to content

Commit 5450202

Browse files
committed
Added Touch and Full Screen support for mobile devices. Also added Random Data Generator and Device classes and organised Point, Rect and the new Circle class into Geom.
1 parent 92cf118 commit 5450202

29 files changed

Lines changed: 5050 additions & 198 deletions

Phaser/Cameras.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="Game.ts" />
22
/// <reference path="GameMath.ts" />
3-
/// <reference path="Rectangle.ts" />
4-
/// <reference path="Point.ts" />
3+
/// <reference path="geom/Rectangle.ts" />
4+
/// <reference path="geom/Point.ts" />
55
/// <reference path="system/Camera.ts" />
66

77
// TODO: If the Camera is larger than the Stage size then the rotation offset isn't correct

Phaser/Emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference path="Group.ts" />
22
/// <reference path="Particle.ts" />
3-
/// <reference path="Point.ts" />
3+
/// <reference path="geom/Point.ts" />
44

55
/**
66
* <code>Emitter</code> is a lightweight particle emitter.

Phaser/Game.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
/// <reference path="World.ts" />
1212
/// <reference path="system/input/Input.ts" />
1313
/// <reference path="system/RequestAnimationFrame.ts" />
14+
/// <reference path="system/RandomDataGenerator.ts" />
15+
/// <reference path="system/Device.ts" />
1416

1517
/**
1618
* Phaser
1719
*
18-
* v0.5 - April 12th 2013
20+
* v0.6 - April 13th 2013
1921
*
2022
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
2123
*
@@ -48,6 +50,8 @@ class Game {
4850

4951
}
5052

53+
public static VERSION: string = 'Phaser version 0.6';
54+
5155
private _raf: RequestAnimationFrame;
5256
private _maxAccumulation: number = 32;
5357
private _accumulator: number = 0;
@@ -56,8 +60,6 @@ class Game {
5660
private _paused: bool = false;
5761
private _pendingState = null;
5862

59-
public static VERSION: string = 'Phaser version 0.5';
60-
6163
// Event callbacks
6264
public callbackContext;
6365
public onInitCallback = null;
@@ -75,6 +77,8 @@ class Game {
7577
public time: Time;
7678
public math: GameMath;
7779
public world: World;
80+
public rnd: RandomDataGenerator;
81+
public device: Device;
7882

7983
public isBooted: bool = false;
8084

@@ -86,6 +90,7 @@ class Game {
8690
}
8791
else
8892
{
93+
this.device = new Device();
8994
this.stage = new Stage(this, parent, width, height);
9095
this.world = new World(this, width, height);
9196
this.sound = new SoundManager(this);
@@ -94,6 +99,7 @@ class Game {
9499
this.time = new Time(this);
95100
this.input = new Input(this);
96101
this.math = new GameMath(this);
102+
this.rnd = new RandomDataGenerator([(Date.now() * Math.random()).toString()]);
97103

98104
this.framerate = 60;
99105

Phaser/GameMath.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference path="Game.ts" />
2+
13
/**
24
* Phaser - GameMath
35
*

Phaser/GameObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference path="Basic.ts" />
22
/// <reference path="Game.ts" />
33
/// <reference path="GameMath.ts" />
4-
/// <reference path="Rectangle.ts" />
5-
/// <reference path="Point.ts" />
4+
/// <reference path="geom/Rectangle.ts" />
5+
/// <reference path="geom/Point.ts" />
66

77
class GameObject extends Basic {
88

Phaser/Phaser.csproj

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -66,8 +66,8 @@
6666
<TypeScriptCompile Include="Group.ts" />
6767
<TypeScriptCompile Include="Loader.ts" />
6868
<TypeScriptCompile Include="Particle.ts" />
69-
<TypeScriptCompile Include="Point.ts" />
70-
<TypeScriptCompile Include="Rectangle.ts" />
69+
<TypeScriptCompile Include="geom\Point.ts" />
70+
<TypeScriptCompile Include="geom\Rectangle.ts" />
7171
<TypeScriptCompile Include="Sound.ts" />
7272
<TypeScriptCompile Include="Sprite.ts" />
7373
<TypeScriptCompile Include="Stage.ts" />
@@ -89,6 +89,19 @@
8989
<TypeScriptCompile Include="Time.ts" />
9090
<TypeScriptCompile Include="World.ts" />
9191
</ItemGroup>
92+
<ItemGroup>
93+
<Content Include="geom\Circle.ts" />
94+
<Content Include="Signal.ts" />
95+
<Content Include="SignalBinding.ts" />
96+
<Content Include="system\Device.ts" />
97+
<Content Include="system\FullScreen.js">
98+
<DependentUpon>FullScreen.ts</DependentUpon>
99+
</Content>
100+
<TypeScriptCompile Include="system\FullScreen.ts" />
101+
<Content Include="system\input\Finger.ts" />
102+
<Content Include="system\input\Touch.ts" />
103+
<Content Include="system\RandomDataGenerator.ts" />
104+
</ItemGroup>
92105
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
93106
<PropertyGroup>
94107
<PostBuildEvent>cd $(ProjectDir)

0 commit comments

Comments
 (0)