Star Struck game back and working again, plus finished the level design.

This commit is contained in:
photonstorm
2013-10-16 03:37:15 +01:00
parent a97f271de7
commit 31018b9295
8 changed files with 120 additions and 164 deletions
+1 -36
View File
@@ -635,28 +635,7 @@ Phaser.Physics.Arcade.prototype = {
*/
separateTile: function (body, tile) {
var separatedX = this.separateTileX(body, tile, true);
var separatedY = this.separateTileY(body, tile, true);
/*
if (separatedX)
{
console.log('x overlap', this._overlap);
}
if (separatedY)
{
console.log('y overlap', this._overlap);
}
if (separatedX || separatedY)
{
return true;
}
*/
if (separatedX || separatedY)
if (this.separateTileX(body, tile, true) || this.separateTileY(body, tile, true))
{
return true;
}
@@ -684,17 +663,11 @@ Phaser.Physics.Arcade.prototype = {
// The hulls overlap, let's process it
this._maxOverlap = body.deltaAbsX() + this.OVERLAP_BIAS;
console.log('sx hulls over');
console.log('x', body.hullX.x, 'y', body.hullX.y, 'bottom', body.hullX.y, 'right', body.hullX.right);
console.log(tile);
if (body.deltaX() < 0)
{
// Moving left
this._overlap = tile.right - body.hullX.x;
console.log('sx left', this._overlap);
if ((this._overlap > this._maxOverlap) || body.allowCollision.left == false || tile.tile.collideRight == false)
{
this._overlap = 0;
@@ -709,8 +682,6 @@ Phaser.Physics.Arcade.prototype = {
// Moving right
this._overlap = body.hullX.right - tile.x;
console.log('sx right', this._overlap);
if ((this._overlap > this._maxOverlap) || body.allowCollision.right == false || tile.tile.collideLeft == false)
{
this._overlap = 0;
@@ -728,15 +699,11 @@ Phaser.Physics.Arcade.prototype = {
{
if (body.deltaX() < 0)
{
console.log('sx sep left 1', body.x);
body.x = body.x + this._overlap;
console.log('sx sep left 2', body.x);
}
else
{
console.log('sx sep right 1', body.x);
body.x = body.x - this._overlap;
console.log('sx sep right 2', body.x);
}
if (body.bounce.x == 0)
@@ -751,12 +718,10 @@ Phaser.Physics.Arcade.prototype = {
body.updateHulls();
}
console.log('%c ', 'background: #7f7f7f')
return true;
}
else
{
console.log('%c ', 'background: #7f7f7f')
return false;
}
-2
View File
@@ -21,8 +21,6 @@ Phaser.Tilemap = function (game, key) {
this.layers = [];
}
console.log(this.layers);
this.currentLayer = 0;
this.debugMap = [];
+4 -4
View File
@@ -179,8 +179,6 @@ Phaser.TilemapLayer.prototype = {
this.game.world.setBounds(0, 0, this.widthInPixels, this.heightInPixels);
console.log('world', this.game.world.bounds);
},
updateTileset: function (tileset) {
@@ -200,6 +198,7 @@ Phaser.TilemapLayer.prototype = {
this.tileWidth = this.tileset.tileWidth;
this.tileHeight = this.tileset.tileHeight;
this.updateMax();
},
@@ -355,7 +354,8 @@ Phaser.TilemapLayer.prototype = {
var tile = this.tileset.tiles[this._column[x]-1];
// if (this.tileset.checkTileIndex(tile))
// {
if (tile)
{
this.context.drawImage(
this.tileset.image,
tile.x,
@@ -367,7 +367,7 @@ Phaser.TilemapLayer.prototype = {
this.tileWidth,
this.tileHeight
);
// }
}
this._tx += this.tileWidth;