mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46:43 +00:00
Updated Phaser to 2.11, Added magnetic tile sprite
This commit is contained in:
parent
1435d31d36
commit
e848fd8b8a
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 686 KiB After Width: | Height: | Size: 581 KiB |
27
Server/src/main/resources/static/js/mar.js
vendored
27
Server/src/main/resources/static/js/mar.js
vendored
@ -269,6 +269,7 @@ var config = {
|
|||||||
wallTint: 0xDDDDDD,
|
wallTint: 0xDDDDDD,
|
||||||
vaultWallTint: 0x3F2D2A,
|
vaultWallTint: 0x3F2D2A,
|
||||||
vaultFloorTint: 0x2B1E1C,
|
vaultFloorTint: 0x2B1E1C,
|
||||||
|
fluidTint: 0x0ACED6,
|
||||||
oreTint: 0xF3F3F3,
|
oreTint: 0xF3F3F3,
|
||||||
cubotHoverTint: 0x00FF00,
|
cubotHoverTint: 0x00FF00,
|
||||||
cubotTint: 0xFFFFFF,
|
cubotTint: 0xFFFFFF,
|
||||||
@ -285,6 +286,7 @@ var config = {
|
|||||||
hologramStroke: "#12FFB0",
|
hologramStroke: "#12FFB0",
|
||||||
copperFill: "#C87D38",
|
copperFill: "#C87D38",
|
||||||
plainSprite: "tiles/tile",
|
plainSprite: "tiles/tile",
|
||||||
|
magneticSprite: "tiles/magneticTile",
|
||||||
wallSprite: "tiles/bigTile",
|
wallSprite: "tiles/bigTile",
|
||||||
wallSprite2: "tiles/bigTile2",
|
wallSprite2: "tiles/bigTile2",
|
||||||
walkDuration: 800,
|
walkDuration: 800,
|
||||||
@ -1436,6 +1438,7 @@ var TileType;
|
|||||||
TileType[TileType["VAULT_FLOOR"] = 4] = "VAULT_FLOOR";
|
TileType[TileType["VAULT_FLOOR"] = 4] = "VAULT_FLOOR";
|
||||||
TileType[TileType["VAULT_WALL"] = 5] = "VAULT_WALL";
|
TileType[TileType["VAULT_WALL"] = 5] = "VAULT_WALL";
|
||||||
TileType[TileType["FLUID"] = 6] = "FLUID";
|
TileType[TileType["FLUID"] = 6] = "FLUID";
|
||||||
|
TileType[TileType["MAGNETIC"] = 7] = "MAGNETIC";
|
||||||
})(TileType || (TileType = {}));
|
})(TileType || (TileType = {}));
|
||||||
var Tile = (function (_super) {
|
var Tile = (function (_super) {
|
||||||
__extends(Tile, _super);
|
__extends(Tile, _super);
|
||||||
@ -1463,6 +1466,8 @@ var Tile = (function (_super) {
|
|||||||
return new VoidTile(x, y);
|
return new VoidTile(x, y);
|
||||||
case TileType.FLUID:
|
case TileType.FLUID:
|
||||||
return new FluidTile(x, y);
|
return new FluidTile(x, y);
|
||||||
|
case TileType.MAGNETIC:
|
||||||
|
return new MagneticTile(x, y);
|
||||||
case TileType.PLAIN:
|
case TileType.PLAIN:
|
||||||
default:
|
default:
|
||||||
return new PlainTile(x, y);
|
return new PlainTile(x, y);
|
||||||
@ -1562,7 +1567,7 @@ var FluidTile = (function (_super) {
|
|||||||
__extends(FluidTile, _super);
|
__extends(FluidTile, _super);
|
||||||
function FluidTile(x, y) {
|
function FluidTile(x, y) {
|
||||||
var _this = _super.call(this, x, y, config.plainSprite, 0) || this;
|
var _this = _super.call(this, x, y, config.plainSprite, 0) || this;
|
||||||
_this.baseTint = 0x0ACED6;
|
_this.baseTint = config.fluidTint;
|
||||||
_this.tint = _this.baseTint;
|
_this.tint = _this.baseTint;
|
||||||
_this.alpha = 0.6;
|
_this.alpha = 0.6;
|
||||||
_this.baseZ = -15;
|
_this.baseZ = -15;
|
||||||
@ -1572,6 +1577,26 @@ var FluidTile = (function (_super) {
|
|||||||
}
|
}
|
||||||
return FluidTile;
|
return FluidTile;
|
||||||
}(Tile));
|
}(Tile));
|
||||||
|
var MagneticTile = (function (_super) {
|
||||||
|
__extends(MagneticTile, _super);
|
||||||
|
|
||||||
|
function MagneticTile(x, y) {
|
||||||
|
var _this = _super.call(this, x, y, config.magneticSprite, 0) || this;
|
||||||
|
_this.baseTint = 0xFFFFFF;
|
||||||
|
_this.tint = _this.baseTint;
|
||||||
|
_this.setText("Magnetic", config.textIron);
|
||||||
|
_this.tileType = "Magnetic tile";
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
MagneticTile.prototype.onHover = function () {
|
||||||
|
mar.game.add.tween(this).to({isoZ: this.baseZ + 30}, 200, Phaser.Easing.Quadratic.InOut, true);
|
||||||
|
mar.tileIndicator.tileX = this.tileX;
|
||||||
|
mar.tileIndicator.tileY = this.tileY;
|
||||||
|
mar.tileIndicator.tileType = this.tileType;
|
||||||
|
};
|
||||||
|
return MagneticTile;
|
||||||
|
}(Tile));
|
||||||
var IronTile = (function (_super) {
|
var IronTile = (function (_super) {
|
||||||
__extends(IronTile, _super);
|
__extends(IronTile, _super);
|
||||||
function IronTile(x, y) {
|
function IronTile(x, y) {
|
||||||
|
11773
Server/src/main/resources/static/js/phaser.js
vendored
11773
Server/src/main/resources/static/js/phaser.js
vendored
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,8 @@ enum TileType {
|
|||||||
COPPER,
|
COPPER,
|
||||||
VAULT_FLOOR,
|
VAULT_FLOOR,
|
||||||
VAULT_WALL,
|
VAULT_WALL,
|
||||||
FLUID
|
FLUID,
|
||||||
|
MAGNETIC
|
||||||
}
|
}
|
||||||
|
|
||||||
class Tile extends Phaser.Plugin.Isometric.IsoSprite {
|
class Tile extends Phaser.Plugin.Isometric.IsoSprite {
|
||||||
@ -73,6 +74,8 @@ class Tile extends Phaser.Plugin.Isometric.IsoSprite {
|
|||||||
return new VoidTile(x, y);
|
return new VoidTile(x, y);
|
||||||
case TileType.FLUID:
|
case TileType.FLUID:
|
||||||
return new FluidTile(x, y);
|
return new FluidTile(x, y);
|
||||||
|
case TileType.MAGNETIC:
|
||||||
|
return new MagneticTile(x, y);
|
||||||
case TileType.PLAIN:
|
case TileType.PLAIN:
|
||||||
default:
|
default:
|
||||||
return new PlainTile(x, y);
|
return new PlainTile(x, y);
|
||||||
@ -164,6 +167,7 @@ class VaultFloorTile extends Tile {
|
|||||||
class VoidTile extends Tile {
|
class VoidTile extends Tile {
|
||||||
|
|
||||||
public onHover() {
|
public onHover() {
|
||||||
|
//don't do animation
|
||||||
mar.tileIndicator.tileX = this.tileX;
|
mar.tileIndicator.tileX = this.tileX;
|
||||||
mar.tileIndicator.tileY = this.tileY;
|
mar.tileIndicator.tileY = this.tileY;
|
||||||
mar.tileIndicator.tileType = this.tileType;
|
mar.tileIndicator.tileType = this.tileType;
|
||||||
@ -185,17 +189,37 @@ class FluidTile extends Tile {
|
|||||||
constructor(x: number, y: number) {
|
constructor(x: number, y: number) {
|
||||||
super(x, y, config.plainSprite, 0);
|
super(x, y, config.plainSprite, 0);
|
||||||
|
|
||||||
this.baseTint = 0x0ACED6;
|
this.baseTint = config.fluidTint;
|
||||||
this.tint = this.baseTint;
|
this.tint = this.baseTint;
|
||||||
this.alpha = 0.6;
|
this.alpha = 0.6;
|
||||||
this.baseZ = -15;
|
this.baseZ = -15;
|
||||||
this.isoZ = this.baseZ;
|
this.isoZ = this.baseZ;
|
||||||
|
|
||||||
|
|
||||||
this.tileType = "fluid";
|
this.tileType = "fluid";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MagneticTile extends Tile {
|
||||||
|
|
||||||
|
public onHover() {
|
||||||
|
mar.game.add.tween(this).to({isoZ: this.baseZ + 30}, 200, Phaser.Easing.Quadratic.InOut, true);
|
||||||
|
|
||||||
|
mar.tileIndicator.tileX = this.tileX;
|
||||||
|
mar.tileIndicator.tileY = this.tileY;
|
||||||
|
mar.tileIndicator.tileType = this.tileType;
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(x: number, y: number) {
|
||||||
|
super(x, y, config.magneticSprite, 0);
|
||||||
|
|
||||||
|
this.baseTint = 0xFFFFFF;
|
||||||
|
this.tint = this.baseTint;
|
||||||
|
|
||||||
|
this.setText("Magnetic", config.textIron);
|
||||||
|
this.tileType = "Magnetic tile";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class IronTile extends Tile {
|
class IronTile extends Tile {
|
||||||
|
|
||||||
constructor(x: number, y: number) {
|
constructor(x: number, y: number) {
|
||||||
|
@ -11,6 +11,7 @@ let config = {
|
|||||||
wallTint: 0xDDDDDD,
|
wallTint: 0xDDDDDD,
|
||||||
vaultWallTint: 0x3F2D2A,
|
vaultWallTint: 0x3F2D2A,
|
||||||
vaultFloorTint: 0x2B1E1C,
|
vaultFloorTint: 0x2B1E1C,
|
||||||
|
fluidTint: 0x0ACED6,
|
||||||
oreTint: 0xF3F3F3,
|
oreTint: 0xF3F3F3,
|
||||||
cubotHoverTint: 0x00FF00,
|
cubotHoverTint: 0x00FF00,
|
||||||
cubotTint: 0xFFFFFF,
|
cubotTint: 0xFFFFFF,
|
||||||
@ -27,6 +28,7 @@ let config = {
|
|||||||
hologramStroke: "#12FFB0",
|
hologramStroke: "#12FFB0",
|
||||||
copperFill: "#C87D38",
|
copperFill: "#C87D38",
|
||||||
plainSprite: "tiles/tile",
|
plainSprite: "tiles/tile",
|
||||||
|
magneticSprite: "tiles/magneticTile",
|
||||||
wallSprite: "tiles/bigTile",
|
wallSprite: "tiles/bigTile",
|
||||||
wallSprite2: "tiles/bigTile2",
|
wallSprite2: "tiles/bigTile2",
|
||||||
walkDuration: 800, //walk animation duration in ms
|
walkDuration: 800, //walk animation duration in ms
|
||||||
|
Loading…
x
Reference in New Issue
Block a user