mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 23:24:41 +00:00
Fixing up Invaders and Star Struck. Also removing lots of un-used css jsdoc themes.
This commit is contained in:
parent
ebf4456e4e
commit
ddf15979d0
16 changed files with 28 additions and 76220 deletions
14
README.md
14
README.md
|
@ -41,19 +41,23 @@ Version 1.1.2
|
|||
|
||||
* New: You'll now find a complete Basic project Template in the resources/Project Templates folder. Will add more complex ones soon.
|
||||
* New: Phaser.Button now has the ability to set over/out/up/down sound effects so they play automatically based on those events.
|
||||
* New: Added init method to plugins, to be called as they are added to the PluginManager (thanks beeglebug)
|
||||
* New: Physics.Body now has a center property (issue 142, thanks MikeMnD)
|
||||
* Updated: Fixed a few final bugs in the Sprite body and bounds calculations, in turn this resolved the Tilemap collision issues in the 1.1 release.
|
||||
* Updated: Finished documentation for the Phaser.Button class.
|
||||
* Updated: Fixed the Invaders game sample and enhanced it.
|
||||
* Updated: Fixed the Star Struck game sample and enhanced it.
|
||||
* Updated: If you pause an Animation, when you next play it it'll resume (un-pause itself).
|
||||
* Updated: hexToRGB now accepts short hex codes (#EEE) (thanks beeglebug)
|
||||
* Fixed issue 135 - Added typeof checks into most ArcadePhysics functions to avoid errors with zero values.
|
||||
* Fixed issue 136 - distanceTo using worldX/Y instead of x/y.
|
||||
* Added init method to plugins, to be called as they are added to the PluginManager (thanks beeglebug)
|
||||
* If you pause an Animation, when you next play it it'll resume (un-pause itself).
|
||||
* New: Physics.Body now has a center property (issue 142, thanks MikeMnD)
|
||||
* Updated: Fixed the Invaders game sample and enhanced it, also fixed lots of "cursor key moves the page" examples.
|
||||
* Fixed lots of examples where the cursor keys / space bar were not locked from moving the browser page (if you find any more, please tell us!)
|
||||
|
||||
|
||||
|
||||
Version 1.1.1 - October 26th 2013
|
||||
|
||||
* Quick patch to get Phaser.AUTO working again on Firefox.
|
||||
* Quick patch to get Phaser.AUTO working again on Firefox / Android.
|
||||
* Any key added via addKey now automatically adds it to the capture list.
|
||||
|
||||
Version 1.1 - October 25th 2013
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -20,8 +20,15 @@ var cursors;
|
|||
var fireButton;
|
||||
var explosions;
|
||||
|
||||
function loadUpdate() {
|
||||
|
||||
console.log('state loadUpdate');
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
||||
|
||||
s = game.add.tileSprite(0, 0, 800, 600, 'starfield');
|
||||
|
||||
player = game.add.sprite(400, 500, 'ship');
|
||||
|
|
|
@ -19,6 +19,8 @@ var layer;
|
|||
var player;
|
||||
var facing = 'left';
|
||||
var jumpTimer = 0;
|
||||
var cursors;
|
||||
var jumpButton;
|
||||
var bg;
|
||||
|
||||
function create() {
|
||||
|
@ -34,8 +36,8 @@ function create() {
|
|||
|
||||
tileset.setCollisionRange(0, tileset.total - 1, true, true, true, true);
|
||||
|
||||
// tileset.setCollisionRange(12, 16, false, false, false, false);
|
||||
// tileset.setCollisionRange(46, 50, false, false, false, false);
|
||||
tileset.setCollisionRange(12, 16, false, false, false, false);
|
||||
tileset.setCollisionRange(46, 50, false, false, false, false);
|
||||
|
||||
layer = game.add.tilemapLayer(0, 0, 800, 600, tileset, map, 0);
|
||||
layer.resizeWorld();
|
||||
|
@ -44,7 +46,7 @@ function create() {
|
|||
player.body.bounce.y = 0.2;
|
||||
player.body.collideWorldBounds = true;
|
||||
player.body.gravity.y = 6;
|
||||
// player.body.setSize(16, 32, 8, 16);
|
||||
player.body.setSize(16, 32, 8, 16);
|
||||
|
||||
player.animations.add('left', [0, 1, 2, 3], 10, true);
|
||||
player.animations.add('turn', [4], 20, true);
|
||||
|
@ -52,18 +54,18 @@ function create() {
|
|||
|
||||
game.camera.follow(player);
|
||||
|
||||
|
||||
cursors = game.input.keyboard.createCursorKeys();
|
||||
jumpButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
|
||||
game.physics.collide(player, layer);
|
||||
|
||||
player.body.velocity.x = 0;
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
if (cursors.left.isDown)
|
||||
{
|
||||
player.body.velocity.x = -150;
|
||||
|
||||
|
@ -73,7 +75,7 @@ function update() {
|
|||
facing = 'left';
|
||||
}
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
|
||||
else if (cursors.right.isDown)
|
||||
{
|
||||
player.body.velocity.x = 150;
|
||||
|
||||
|
@ -102,13 +104,10 @@ function update() {
|
|||
}
|
||||
}
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.UP) || game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR))
|
||||
if (jumpButton.isDown && player.body.touching.down && game.time.now > jumpTimer)
|
||||
{
|
||||
if (player.body.touching.down && game.time.now > jumpTimer)
|
||||
{
|
||||
player.body.velocity.y = -250;
|
||||
jumpTimer = game.time.now + 750;
|
||||
}
|
||||
player.body.velocity.y = -250;
|
||||
jumpTimer = game.time.now + 750;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue