Final 0.9.4 release

This commit is contained in:
Richard Davey
2013-04-28 21:51:55 +01:00
parent 21120c8b62
commit 86c872803a
10 changed files with 48 additions and 185 deletions
+37 -10
View File
@@ -2,7 +2,7 @@ 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: {
@@ -14,18 +14,45 @@ module.exports = function (grunt) {
}
}
},
copy: {
main: {
files: [
{src: 'build/phaser.js', dest: 'Tests/phaser.js'}
]}
},
copy: {
main: {
files: [{
src: 'build/phaser.js',
dest: 'Tests/phaser.js'
}]
},
amd: {
files: [{
src: 'build/phaser.js',
dest: 'build/phaser.amd.js'
}],
options: {
processContent: function(content) {
var replacement = [
'(function (root, factory) {',
' if (typeof exports === \'object\') {',
' module.exports = factory();',
' } else if (typeof define === \'function\' && define.amd) {',
' define(factory);',
' } else {',
' root.Phaser = factory();',
' }',
'}(this, function () {',
content,
'return Phaser;',
'}));'
];
return replacement.join('\n');
}
}
}
},
watch: {
files: '**/*.ts',
tasks: ['typescript', 'copy']
}
});
grunt.registerTask('default', ['watch']);
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Phaser
*
* v0.9.4 - April 24th 2013
* v0.9.4 - April 28th 2013
*
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
*
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* Phaser
*
* v0.9.4 - April 24th 2013
* v0.9.4 - April 28th 2013
*
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
*
+3 -4
View File
@@ -1,7 +1,7 @@
Phaser
======
Version: 0.9.4 Released: XX April 2013
Version: 0.9.4 Released: 28th April 2013
By Richard Davey, [Photon Storm](http://www.photonstorm.com)
@@ -20,16 +20,15 @@ Latest Update
V0.9.4
* Fixed Tilemap bounds check if map was smaller than game dimensions
* Added Tilemap.getTile, getTileFromWorldXY, getTileFromInputXY
* Added Tilemap.setCollisionByIndex and setCollisionByRange
* Added GameObject.renderRotation boolean to control if the sprite will visually rotate or not (useful when angle needs to change but graphics don't)
* Added additional check to Camera.width/height so you cannot set them larger than the Stage size
* Added Collision.separateTile and Tilemap.collide
* Fixed Tilemap bounds check if map was smaller than game dimensions
* Fixed: Made World._cameras public, World.cameras and turned Game.camera into a getter for it (thanks Hackmaniac)
* Fixed: Circle.isEmpty properly checks diameter (thanks bapuna)
* Updated Gruntfile to export new version of phaser.js wrapped in a UMD block for require.js/commonJS (thanks Hackmaniac)
Requirements
------------
-40
View File
@@ -1,40 +0,0 @@
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {
myGame.loader.addTextFile('jsontest', 'assets/maps/test.json');
myGame.loader.addImageFile('jsontiles', 'assets/tiles/platformer_tiles.png');
myGame.loader.load();
}
var car;
var map;
var hasGrabbed = false;
function create() {
myGame.camera.deadzone = new Phaser.Rectangle(64, 64, myGame.stage.width - 128, myGame.stage.height - 128);
map = myGame.createTilemap('jsontiles', 'jsontest', Phaser.Tilemap.FORMAT_TILED_JSON);
// for now like this, but change to auto soon
myGame.world.setSize(map.widthInPixels, map.heightInPixels);
myGame.camera.setBounds(0, 0, myGame.world.width, myGame.world.height);
car = myGame.createSprite(300, 100, 'car');
myGame.camera.follow(car);
}
function update() {
car.velocity.x = 0;
car.velocity.y = 0;
car.angularVelocity = 0;
car.angularAcceleration = 0;
if(myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
car.angularVelocity = -200;
} else if(myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
car.angularVelocity = 200;
}
if(myGame.input.keyboard.isDown(Phaser.Keyboard.UP)) {
var motion = myGame.motion.velocityFromAngle(car.angle, 300);
car.velocity.copyFrom(motion);
}
if(myGame.input.keyboard.justReleased(Phaser.Keyboard.SPACEBAR) && hasGrabbed == false) {
console.log('graboids');
hasGrabbed = true;
}
}
})();
-67
View File
@@ -1,67 +0,0 @@
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
function init() {
myGame.loader.addTextFile('jsontest', 'assets/maps/test.json');
myGame.loader.addImageFile('jsontiles', 'assets/tiles/platformer_tiles.png');
myGame.loader.load();
}
var car: Phaser.Sprite;
var map: Phaser.Tilemap;
var hasGrabbed: bool = false;
function create() {
myGame.camera.deadzone = new Phaser.Rectangle(64, 64, myGame.stage.width - 128, myGame.stage.height - 128);
map = myGame.createTilemap('jsontiles', 'jsontest', Phaser.Tilemap.FORMAT_TILED_JSON);
// for now like this, but change to auto soon
myGame.world.setSize(map.widthInPixels, map.heightInPixels);
myGame.camera.setBounds(0, 0, myGame.world.width, myGame.world.height);
car = myGame.createSprite(300, 100, 'car');
myGame.camera.follow(car);
}
function update() {
car.velocity.x = 0;
car.velocity.y = 0;
car.angularVelocity = 0;
car.angularAcceleration = 0;
if (myGame.input.keyboard.isDown(Phaser.Keyboard.LEFT))
{
car.angularVelocity = -200;
}
else if (myGame.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
{
car.angularVelocity = 200;
}
if (myGame.input.keyboard.isDown(Phaser.Keyboard.UP))
{
var motion:Phaser.Point = myGame.motion.velocityFromAngle(car.angle, 300);
car.velocity.copyFrom(motion);
}
if (myGame.input.keyboard.justReleased(Phaser.Keyboard.SPACEBAR) && hasGrabbed == false)
{
console.log('graboids');
hasGrabbed = true;
}
}
})();
+3 -2
View File
@@ -7,6 +7,7 @@
myGame.loader.addImageFile('tiles', 'assets/tiles/platformer_tiles.png');
myGame.loader.addImageFile('ufo', 'assets/sprites/ufo.png');
myGame.loader.addImageFile('melon', 'assets/sprites/melon.png');
myGame.loader.addImageFile('chunk', 'assets/sprites/chunk.png');
myGame.loader.load();
}
var map;
@@ -27,10 +28,10 @@
]);
emitter = myGame.createEmitter(32, 80);
emitter.width = 700;
emitter.makeParticles('melon', 100, 0, false, 0);
emitter.makeParticles('chunk', 100, 0, false, 1);
emitter.gravity = 200;
emitter.bounce = 0.8;
emitter.start(false, 10, 0.1);
emitter.start(false, 10, 0.05);
car = myGame.createSprite(250, 64, 'ufo');
car.renderRotation = false;
test = myGame.createSprite(200, 64, 'ufo');
+3 -2
View File
@@ -11,6 +11,7 @@
myGame.loader.addImageFile('tiles', 'assets/tiles/platformer_tiles.png');
myGame.loader.addImageFile('ufo', 'assets/sprites/ufo.png');
myGame.loader.addImageFile('melon', 'assets/sprites/melon.png');
myGame.loader.addImageFile('chunk', 'assets/sprites/chunk.png');
myGame.loader.load();
@@ -34,10 +35,10 @@
emitter = myGame.createEmitter(32, 80);
emitter.width = 700;
emitter.makeParticles('melon', 100, 0, false, 0);
emitter.makeParticles('chunk', 100, 0, false, 1);
emitter.gravity = 200;
emitter.bounce = 0.8;
emitter.start(false, 10, 0.1);
emitter.start(false, 10, 0.05);
car = myGame.createSprite(250, 64, 'ufo');
car.renderRotation = false;
-22
View File
@@ -1,22 +0,0 @@
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create);
function init() {
myGame.loader.addImageFile('atari', 'assets/sprites/atari130xe.png');
myGame.loader.load();
}
var atari;
function create() {
atari = myGame.createSprite(300, 0, 'atari');
startBounceTween();
}
function startBounceTween() {
atari.y = 0;
var bounce = myGame.createTween(atari);
bounce.to({
x: 2
}, 1000 + Math.random() * 3000, Phaser.Easing.Bounce.Out);
bounce.onComplete.add(startBounceTween, this);
bounce.start();
}
})();
-36
View File
@@ -1,36 +0,0 @@
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create);
function init() {
myGame.loader.addImageFile('atari', 'assets/sprites/atari130xe.png');
myGame.loader.load();
}
var atari: Phaser.Sprite;
function create() {
atari = myGame.createSprite(300, 0, 'atari');
startBounceTween();
}
function startBounceTween() {
atari.y = 0;
var bounce: Phaser.Tween = myGame.createTween(atari);
bounce.to({ x: 2 }, 1000 + Math.random() * 3000, Phaser.Easing.Bounce.Out);
bounce.onComplete.add(startBounceTween, this);
bounce.start();
}
})();