Added grunt file and npm package for OSX debs

This commit is contained in:
Richard Davey 2013-04-20 01:24:38 +01:00
parent 1217bf4722
commit 364492d786
7 changed files with 2985 additions and 10622 deletions

31
GruntFile.js Normal file
View file

@ -0,0 +1,31 @@
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
typescript: {
base: {
src: ['Phaser/**/*.ts'],
dest: 'build/phaser.js',
options: {
target: 'ES5'
}
}
},
copy: {
main: {
files: [
{src: 'build/phaser.js', dest: 'Tests/phaser.js'}
]}
},
watch: {
files: '**/*.ts',
tasks: ['typescript', 'copy']
}
});
grunt.registerTask('default', ['watch']);
}

View file

@ -520,6 +520,14 @@ module Phaser {
this._angle = this._game.math.wrap(value, 360, 0); this._angle = this._game.math.wrap(value, 360, 0);
} }
public set width(value:number) {
this.bounds.width = value;
}
public set height(value:number) {
this.bounds.height = value;
}
public get width(): number { public get width(): number {
return this.bounds.width; return this.bounds.width;
} }

View file

@ -1,6 +1,7 @@
/// <reference path="../Game.ts" /> /// <reference path="../Game.ts" />
/// <reference path="../AnimationManager.ts" /> /// <reference path="../AnimationManager.ts" />
/// <reference path="GameObject.ts" /> /// <reference path="GameObject.ts" />
/// <reference path="../system/Camera.ts" />
/** /**
* Phaser - Sprite * Phaser - Sprite
@ -125,7 +126,7 @@ module Phaser {
} }
public set frame(value?: number) { public set frame(value: number) {
this.animations.frame = value; this.animations.frame = value;
} }
@ -133,7 +134,7 @@ module Phaser {
return this.animations.frame; return this.animations.frame;
} }
public set frameName(value?: string) { public set frameName(value: string) {
this.animations.frameName = value; this.animations.frameName = value;
} }
@ -228,7 +229,7 @@ module Phaser {
this._dy -= (camera.worldView.y * this.scrollFactor.y); this._dy -= (camera.worldView.y * this.scrollFactor.y);
} }
// Rotation // Rotation - needs to be set from origin
if (this.angle !== 0) if (this.angle !== 0)
{ {
this._game.stage.context.save(); this._game.stage.context.save();
@ -287,7 +288,7 @@ module Phaser {
if (this.renderDebug) if (this.renderDebug)
{ {
this.renderBounds(); this.renderBounds(camera, cameraOffsetX, cameraOffsetY);
} }
//if (this.flip === true || this.rotation !== 0) //if (this.flip === true || this.rotation !== 0)
@ -306,7 +307,11 @@ module Phaser {
} }
private renderBounds() { // Renders the bounding box around this Sprite and the contact points. Useful for visually debugging.
private renderBounds(camera:Camera, cameraOffsetX:number, cameraOffsetY:number) {
this._dx = cameraOffsetX + (this.bounds.topLeft.x - camera.worldView.x);
this._dy = cameraOffsetY + (this.bounds.topLeft.y - camera.worldView.y);
this._game.stage.context.fillStyle = this.renderDebugColor; this._game.stage.context.fillStyle = this.renderDebugColor;
this._game.stage.context.fillRect(this._dx, this._dy, this._dw, this._dh); this._game.stage.context.fillRect(this._dx, this._dy, this._dw, this._dh);

View file

@ -1,18 +1,3 @@
/**
* Phaser
*
* v0.9.1 - April 19th 2013
*
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
*
* Richard Davey (@photonstorm)
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for the original Flixel AS3 code on which Phaser is based.
*
* "If you want your children to be intelligent, read them fairy tales."
* "If you want them to be more intelligent, read them more fairy tales."
* -- Albert Einstein
*/
var Phaser; var Phaser;
(function (Phaser) { (function (Phaser) {
Phaser.VERSION = 'Phaser version 0.9.1'; Phaser.VERSION = 'Phaser version 0.9.1';

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

32
package.json Normal file
View file

@ -0,0 +1,32 @@
{
"name": "Phaser",
"version": "0.9.1",
"description": "html5 game framework",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://photonstorm@github.com/photonstorm/phaser.git"
},
"keywords": [
"HTML5",
"game",
"canvas",
"2d"
],
"author": "Richard Davey",
"license": "BSD",
"readmeFilename": "README.md",
"gitHead": "1217bf4722768514fe15ff904dab59f848d146f4",
"devDependencies": {
"grunt": "~0.4.1",
"typescript": "~0.8.3",
"grunt-typescript": "~0.1.4",
"grunt-contrib-watch": "~0.3.1",
"grunt-contrib-connect": "~0.3.0",
"grunt-open": "~0.2.0",
"grunt-contrib-copy": "~0.4.1"
}
}