mirror of
https://github.com/wassname/phaser-plugin-isometric.git
synced 2026-09-10 12:29:48 +08:00
Fixed a conflict in dist file
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
Fork changelog
|
||||
==============
|
||||
[02.04.2015] - Fix for Phaser 2.3 courtesy of @[mfpierre](https://github.com/mfpierre)
|
||||
|
||||
[14.10.2014] - Added Typescript Support
|
||||
|
||||
|
||||
Phaser Isometric Plug-in
|
||||
=======================
|
||||
|
||||
|
||||
Vendored
+15
-9
@@ -45,15 +45,15 @@
|
||||
Phaser.Plugin.Isometric = function (game, parent) {
|
||||
|
||||
Phaser.Plugin.call(this, game, parent);
|
||||
|
||||
this.projector = new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
// Add an instance of Isometric.Projector to game.iso if it doesn't exist already
|
||||
this.game.iso = this.game.iso || new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
this.game.iso = this.game.iso || this.projector;
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype = Object.create(Phaser.Plugin.prototype);
|
||||
Phaser.Plugin.Isometric.prototype.constructor = Phaser.Plugin.Isometric;
|
||||
|
||||
Phaser.Plugin.Isometric.VERSION = '0.9.1';
|
||||
Phaser.Plugin.Isometric.VERSION = '0.9.2';
|
||||
|
||||
// Directional consts
|
||||
Phaser.Plugin.Isometric.UP = 0;
|
||||
@@ -68,10 +68,10 @@ Phaser.Plugin.Isometric.ISOSPRITE = 'isosprite';
|
||||
Phaser.Plugin.Isometric.ISOARCADE = 'isoarcade';
|
||||
;/**
|
||||
* @class Phaser.Plugin.Isometric.Cube
|
||||
*
|
||||
*
|
||||
* @classdesc
|
||||
* Creates a new Cube object with the bottom-back corner specified by the x, y and z parameters, with the specified breadth (widthX), depth (widthY) and height parameters. If you call this function without parameters, a Cube with x, y, z, breadth, depth and height properties set to 0 is created.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @param {number} x - The x coordinate of the bottom-back corner of the Cube.
|
||||
* @param {number} y - The y coordinate of the bottom-back corner of the Cube.
|
||||
@@ -648,7 +648,7 @@ Phaser.Plugin.Isometric.Cube.contains = function (a, x, y, z) {
|
||||
* @return {boolean} A value of true if the Cube object contains the specified point; otherwise false.
|
||||
*/
|
||||
Phaser.Plugin.Isometric.Cube.containsXY = function (a, x, y) {
|
||||
if (a.widthX <= 0 || a.widthY <= 0 || a.height <= 0) {
|
||||
if (a.widthX <= 0 || a.widthY <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -965,6 +965,12 @@ Phaser.GameObjectFactory.prototype.isoSprite = function (x, y, z, key, frame, gr
|
||||
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype.addIsoSprite = function (x, y, z, key, frame, group) {
|
||||
return Phaser.GameObjectFactory.prototype.isoSprite.call(this.game.add, x, y, z, key, frame, group);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Phaser.Utils.Debug.prototype.isoSprite = function (sprite, color, filled) {
|
||||
|
||||
if (!sprite.isoBounds) {
|
||||
@@ -1968,11 +1974,11 @@ Object.defineProperty(Phaser.Plugin.Isometric.Projector.prototype, "projectionAn
|
||||
|
||||
});;/**
|
||||
* @class Phaser.Plugin.Isometric.Body
|
||||
*
|
||||
*
|
||||
* @classdesc
|
||||
* The Physics Body is linked to a single IsoSprite. All physics operations should be performed against the body rather than
|
||||
* the IsoSprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @param {Phaser.Plugin.Isometric.IsoSprite} sprite - The IsoSprite object this physics body belongs to.
|
||||
*/
|
||||
@@ -2453,7 +2459,7 @@ Phaser.Plugin.Isometric.Body.prototype = {
|
||||
|
||||
this.preRotation = this.rotation;
|
||||
|
||||
if (this._reset || this.sprite._cache[4] === 1) {
|
||||
if (this._reset || this.sprite.fresh === true) {
|
||||
this.prev.x = this.position.x;
|
||||
this.prev.y = this.position.y;
|
||||
this.prev.z = this.position.z;
|
||||
|
||||
Vendored
+327
@@ -0,0 +1,327 @@
|
||||
//debug octreee is missing - Octree
|
||||
//debug isoSprite is missing - IsoSprite
|
||||
//gameobjectcreator isoSprite missing - IsoSprite
|
||||
//gameobjectfactory isoSprite missing - IsoSprite
|
||||
//debug body missing - Body
|
||||
//debug bodyInfo missing -Body
|
||||
declare module Phaser.Plugin {
|
||||
|
||||
class Isometric extends Phaser.Plugin {
|
||||
|
||||
static CLASSIC: number;
|
||||
static ISOMETRIC: number;
|
||||
static MILITARY: number;
|
||||
|
||||
static VERSION: string;
|
||||
static UP: number;
|
||||
static DOWN: number;
|
||||
static FORWARDX: number;
|
||||
static FORWARDY: number;
|
||||
static BACKWARDX: number;
|
||||
static BACKWARDY: number;
|
||||
|
||||
static ISOSPRITE: number;
|
||||
static ISOARCADE: number;
|
||||
|
||||
projector: Phaser.Plugin.Isometric.Projector;
|
||||
|
||||
constructor(game: Phaser.Game, parent?: any);
|
||||
|
||||
addIsoSprite(x: number, y: number, z: number, key?: any, frame?: any, group?: Phaser.Group): Phaser.Sprite;
|
||||
|
||||
}
|
||||
|
||||
module Isometric {
|
||||
|
||||
class Projector {
|
||||
|
||||
game: Phaser.Game;
|
||||
anchor: Phaser.Point;
|
||||
projectionAngle: number;
|
||||
|
||||
project(point3: Phaser.Plugin.Isometric.Point3, out?: Phaser.Point): Phaser.Point;
|
||||
projectXY(point3: Phaser.Plugin.Isometric.Point3, out?: Phaser.Point): Phaser.Point;
|
||||
unproject(point: Phaser.Point, out?: Phaser.Plugin.Isometric.Point3, z?: number): Phaser.Plugin.Isometric.Point3;
|
||||
simpleSort(group: Phaser.Group): void;
|
||||
topologicalSort(group: Phaser.Group, padding?: number, prop?: string): void;
|
||||
|
||||
}
|
||||
|
||||
class Point3 {
|
||||
|
||||
static add(a: Phaser.Plugin.Isometric.Point3, b: Phaser.Plugin.Isometric.Point3, out?: Phaser.Plugin.Isometric.Point3): Phaser.Plugin.Isometric.Point3;
|
||||
static subtract(a: Phaser.Plugin.Isometric.Point3, b: Phaser.Plugin.Isometric.Point3, out?: Phaser.Plugin.Isometric.Point3): Phaser.Plugin.Isometric.Point3;
|
||||
static multiply(a: Phaser.Plugin.Isometric.Point3, b: Phaser.Plugin.Isometric.Point3, out?: Phaser.Plugin.Isometric.Point3): Phaser.Plugin.Isometric.Point3;
|
||||
static divide(a: Phaser.Plugin.Isometric.Point3, b: Phaser.Plugin.Isometric.Point3, out?: Phaser.Plugin.Isometric.Point3): Phaser.Plugin.Isometric.Point3;
|
||||
static equals(a: Phaser.Plugin.Isometric.Point3, b: Phaser.Plugin.Isometric.Point3): boolean;
|
||||
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
|
||||
constructor(x?: number, y?: number, z?: number);
|
||||
|
||||
copyFrom(source: any): Phaser.Plugin.Isometric.Point3;
|
||||
copyto(dest: any): any;
|
||||
equals(a: any): boolean;
|
||||
set(x?: number, y?: number, z?: number): Phaser.Plugin.Isometric.Point3;
|
||||
setTo(x?: number, y?: number, z?: number): Phaser.Plugin.Isometric.Point3;
|
||||
add(x?: number, y?: number): Phaser.Plugin.Isometric.Point3;
|
||||
subtract(x?: number, y?: number, z?: number): Phaser.Plugin.Isometric.Point3;
|
||||
multiply(x?: number, y?: number, z?: number): Phaser.Plugin.Isometric.Point3;
|
||||
divide(x?: number, y?: number, z?: number): Phaser.Plugin.Isometric.Point3;
|
||||
|
||||
}
|
||||
|
||||
class Octree {
|
||||
|
||||
maxObjects: number;
|
||||
maxLevels: number;
|
||||
level: number;
|
||||
bounds: any;
|
||||
objects: any[];
|
||||
nodes: any[];
|
||||
|
||||
constructor(x: number, y: number, z: number, widthX: number, widthY: number, height: number, maxObject?: number, maxLevels?: number, level?: number);
|
||||
|
||||
reset(x: number, y: number, z: number, widthX: number, widthY: number, height: number, maxObject?: number, maxLevels?: number, level?: number): void;
|
||||
populate(group: Phaser.Group);
|
||||
populateHandler(sprite: Phaser.Plugin.Isometric.IsoSprite): void;
|
||||
populateHandler(sprite: any): void;
|
||||
split(): void;
|
||||
insert(body: Phaser.Plugin.Isometric.Body): void;
|
||||
insert(body: Phaser.Plugin.Isometric.Cube): void;
|
||||
insert(body: any): void;
|
||||
getIndex(cube: Phaser.Plugin.Isometric.Cube): number;
|
||||
getIndex(cube: any): number;
|
||||
retrieve(source: Phaser.Plugin.Isometric.IsoSprite): any[];
|
||||
retrieve(source: Phaser.Plugin.Isometric.Cube): any[];
|
||||
clear(): void;
|
||||
|
||||
}
|
||||
|
||||
class IsoSprite extends Phaser.Sprite {
|
||||
|
||||
snap: number;
|
||||
isoX: number;
|
||||
isoY: number;
|
||||
isoZ: number;
|
||||
isoPosition: Phaser.Plugin.Isometric.Point3;
|
||||
isoBounds: Phaser.Plugin.Isometric.Point3;
|
||||
depth: number;
|
||||
|
||||
constructor(game: Phaser.Game, x: number, y: number, z: number, key?: any, frame?: any);
|
||||
|
||||
resetIsoBounds(): void;
|
||||
|
||||
}
|
||||
|
||||
class Cube {
|
||||
|
||||
static size(a: Phaser.Plugin.Isometric.Cube, output?: Phaser.Plugin.Isometric.Point3): Phaser.Plugin.Isometric.Point3;
|
||||
static clone(a: Phaser.Plugin.Isometric.Cube, output?: Phaser.Plugin.Isometric.Cube): Phaser.Plugin.Isometric.Cube;
|
||||
static contains(a: Phaser.Plugin.Isometric.Cube, x: number, y: number, z: number): boolean;
|
||||
static containsXY(a: Phaser.Plugin.Isometric.Cube, x: number, y: number): boolean;
|
||||
static containsPoint3(a: Phaser.Plugin.Isometric.Cube, point3: Phaser.Plugin.Isometric.Point3): boolean;
|
||||
static containsCube(a: Phaser.Plugin.Isometric.Cube, b: Phaser.Plugin.Isometric.Cube): boolean;
|
||||
static intersects(a: Phaser.Plugin.Isometric.Cube, b: Phaser.Plugin.Isometric.Cube): boolean;
|
||||
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
widthX: number;
|
||||
widthY: number;
|
||||
height: number;
|
||||
halfWidthX: number;
|
||||
halfWidthY: number;
|
||||
halfHeight: number;
|
||||
bottom: number;
|
||||
top: number;
|
||||
backX: number;
|
||||
backY: number;
|
||||
frontX: number;
|
||||
frontY: number;
|
||||
volume: number;
|
||||
centerX: number;
|
||||
centerY: number;
|
||||
centerZ: number;
|
||||
randomX: number;
|
||||
randomY: number;
|
||||
randomZ: number;
|
||||
empty: boolean;
|
||||
|
||||
constructor(x?: number, y?: number, z?: number, widthX?: number, widthY?: number, height?: number);
|
||||
|
||||
setTo(x?: number, y?: number, z?: number, widthX?: number, widthY?: number, height?: number): Phaser.Plugin.Isometric.Cube;
|
||||
copyFrom(source: any): Phaser.Plugin.Isometric.Cube;
|
||||
copyTo(dest: any): Phaser.Plugin.Isometric.Cube;
|
||||
size(output?: Phaser.Plugin.Isometric.Point3): Phaser.Plugin.Isometric.Point3;
|
||||
contains(x: number, y: number, z: number): boolean;
|
||||
containsXY(x: number, y: number): boolean;
|
||||
clone(output?: Phaser.Plugin.Isometric.Cube): Phaser.Plugin.Isometric.Cube;
|
||||
intersects(b: Phaser.Plugin.Isometric.Cube): boolean;
|
||||
getCorners(): Phaser.Plugin.Isometric.Point3[];
|
||||
toString(): string;
|
||||
|
||||
}
|
||||
|
||||
class Body {
|
||||
|
||||
static render(context: any, body: Phaser.Plugin.Isometric.Body, color?: string, filled?: boolean): void;
|
||||
static renderBodyInfo(debug: any, body: Phaser.Plugin.Isometric.Body): void; //togo debug?
|
||||
|
||||
sprite: Phaser.Plugin.Isometric.IsoSprite;
|
||||
game: Phaser.Game;
|
||||
type: number;
|
||||
enable: boolean;
|
||||
offset: Phaser.Plugin.Isometric.Point3;
|
||||
position: Phaser.Plugin.Isometric.Point3;
|
||||
prev: Phaser.Plugin.Isometric.Point3;
|
||||
allowRotation: boolean;
|
||||
rotation: number;
|
||||
preRotation: number;
|
||||
sourceWidthX: number;
|
||||
sourceWidthY: number;
|
||||
sourceHeight: number;
|
||||
widthX: number;
|
||||
widthY: number;
|
||||
height: number;
|
||||
halfWidthX: number;
|
||||
halfWidthY: number;
|
||||
halfHeight: number;
|
||||
center: Phaser.Plugin.Isometric.Point3;
|
||||
velocity: Phaser.Plugin.Isometric.Point3;
|
||||
newVelocity: Phaser.Plugin.Isometric.Point3;
|
||||
deltaMax: Phaser.Plugin.Isometric.Point3;
|
||||
acceleration: Phaser.Plugin.Isometric.Point3;
|
||||
drag: Phaser.Plugin.Isometric.Point3;
|
||||
allowGravity: boolean;
|
||||
gravity: Phaser.Plugin.Isometric.Point3;
|
||||
bounce: Phaser.Plugin.Isometric.Point3;
|
||||
maxVelocity: Phaser.Plugin.Isometric.Point3;
|
||||
angularVelocity: number;
|
||||
angularAcceleration: number;
|
||||
angularDrag: number;
|
||||
maxAngular: number;
|
||||
mass: number;
|
||||
angle: number;
|
||||
speed: number;
|
||||
facing: number;
|
||||
immovable: boolean;
|
||||
moves: boolean;
|
||||
customSeparateX: boolean;
|
||||
customSeparateY: boolean;
|
||||
customSeparateZ: boolean;
|
||||
overlapX: number;
|
||||
overlapY: number;
|
||||
overlayZ: number;
|
||||
embedded: boolean;
|
||||
collideWorldBounds: boolean;
|
||||
checkCollision: {
|
||||
none: boolean;
|
||||
any: boolean;
|
||||
up: boolean;
|
||||
down: boolean;
|
||||
frontX: number;
|
||||
frontY: number;
|
||||
backX: number;
|
||||
backY: number;
|
||||
};
|
||||
touching: {
|
||||
none: boolean;
|
||||
up: boolean;
|
||||
down: boolean;
|
||||
frontX: number;
|
||||
frontY: number;
|
||||
backX: number;
|
||||
backY: number;
|
||||
};
|
||||
wasTouching: {
|
||||
none: boolean;
|
||||
up: boolean;
|
||||
down: boolean;
|
||||
frontX: number;
|
||||
frontY: number;
|
||||
backX: number;
|
||||
backY: number;
|
||||
};
|
||||
blocked: {
|
||||
up: boolean;
|
||||
down: boolean;
|
||||
frontX: number;
|
||||
frontY: number;
|
||||
backX: number;
|
||||
backY: number;
|
||||
};
|
||||
phase: number;
|
||||
skipTree: boolean;
|
||||
top: number;
|
||||
frontX: number;
|
||||
right: number;
|
||||
frontY: number;
|
||||
bottom: number;
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
|
||||
constructor(sprite: Phaser.Plugin.Isometric.IsoSprite);
|
||||
|
||||
destroy(): void;
|
||||
setSize(widthX: number, widthY: number, height: number, offsetX?: number, offsetY?: number, offsetZ?: number): void;
|
||||
reset(x: number, y: number, z: number): void;
|
||||
hitText(x: number, y: number, z: number): boolean;
|
||||
onFloor(): boolean;
|
||||
onWall(): boolean;
|
||||
deltaAbsX(): number;
|
||||
deltaAbsY(): number;
|
||||
deltaAbsZ(): number;
|
||||
deltaX(): number;
|
||||
deltaY(): number;
|
||||
deltaZ(): number;
|
||||
deltaR(): number;
|
||||
getCorners(): Phaser.Plugin.Isometric.Point3[];
|
||||
|
||||
}
|
||||
|
||||
class Arcade {
|
||||
|
||||
game: Phaser.Game;
|
||||
gravity: Phaser.Plugin.Isometric.Point3;
|
||||
bounds: Phaser.Plugin.Isometric.Cube;
|
||||
checkCollision: {
|
||||
up: boolean;
|
||||
down: boolean;
|
||||
frontX: boolean;
|
||||
frontY: boolean;
|
||||
backX: boolean;
|
||||
backY: boolean;
|
||||
};
|
||||
maxObjects: number;
|
||||
maxLevels: number;
|
||||
OVERLAP_BIAS: number;
|
||||
forceXY: boolean;
|
||||
skipTree: boolean;
|
||||
useQuadTree: boolean;
|
||||
quadTree: Phaser.QuadTree;
|
||||
octree: Phaser.Plugin.Isometric.Octree;
|
||||
|
||||
constructor(game: Phaser.Game);
|
||||
|
||||
setBounds(x: number, y: number, z: number, widthX: number, widthY: number, height: number): void;
|
||||
setBoundsToWorld(): void;
|
||||
enable(object: any, children?: boolean): void;
|
||||
enableBody(object: any): void;
|
||||
updateMotion(body: Phaser.Plugin.Isometric.Body): void;
|
||||
computeVelocity(axis: number, body: Phaser.Plugin.Isometric.Body, velocity: number, acceleration: number, drag: number, max?: number): number;
|
||||
overlap(object1: any, object2: any, overlapCallback?: Function, processCallback?: Function, callbackContext?: any): boolean;
|
||||
collide(object1: any, object2: any, overlapCallback?: Function, processCallback?: Function, callbackContext?: any): boolean;
|
||||
intersects(body1: Phaser.Plugin.Isometric.Body): boolean;
|
||||
distanceBetween(source: any, target: any): number;
|
||||
distanceToXY(displayObject: any, x: number, y: number): number;
|
||||
distanceToXYZ(displayObject: any, x: number, y: number, z: number): number;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* @class Phaser.Plugin.Isometric.Cube
|
||||
*
|
||||
*
|
||||
* @classdesc
|
||||
* Creates a new Cube object with the bottom-back corner specified by the x, y and z parameters, with the specified breadth (widthX), depth (widthY) and height parameters. If you call this function without parameters, a Cube with x, y, z, breadth, depth and height properties set to 0 is created.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @param {number} x - The x coordinate of the bottom-back corner of the Cube.
|
||||
* @param {number} y - The y coordinate of the bottom-back corner of the Cube.
|
||||
@@ -580,7 +580,7 @@ Phaser.Plugin.Isometric.Cube.contains = function (a, x, y, z) {
|
||||
* @return {boolean} A value of true if the Cube object contains the specified point; otherwise false.
|
||||
*/
|
||||
Phaser.Plugin.Isometric.Cube.containsXY = function (a, x, y) {
|
||||
if (a.widthX <= 0 || a.widthY <= 0 || a.height <= 0) {
|
||||
if (a.widthX <= 0 || a.widthY <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -264,6 +264,12 @@ Phaser.GameObjectFactory.prototype.isoSprite = function (x, y, z, key, frame, gr
|
||||
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype.addIsoSprite = function (x, y, z, key, frame, group) {
|
||||
return Phaser.GameObjectFactory.prototype.isoSprite.call(this.game.add, x, y, z, key, frame, group);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Phaser.Utils.Debug.prototype.isoSprite = function (sprite, color, filled) {
|
||||
|
||||
if (!sprite.isoBounds) {
|
||||
|
||||
+2
-2
@@ -45,9 +45,9 @@
|
||||
Phaser.Plugin.Isometric = function (game, parent) {
|
||||
|
||||
Phaser.Plugin.call(this, game, parent);
|
||||
|
||||
this.projector = new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
// Add an instance of Isometric.Projector to game.iso if it doesn't exist already
|
||||
this.game.iso = this.game.iso || new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
this.game.iso = this.game.iso || this.projector;
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype = Object.create(Phaser.Plugin.prototype);
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @class Phaser.Plugin.Isometric.Body
|
||||
*
|
||||
*
|
||||
* @classdesc
|
||||
* The Physics Body is linked to a single IsoSprite. All physics operations should be performed against the body rather than
|
||||
* the IsoSprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body.
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
* @param {Phaser.Plugin.Isometric.IsoSprite} sprite - The IsoSprite object this physics body belongs to.
|
||||
*/
|
||||
@@ -485,7 +485,7 @@ Phaser.Plugin.Isometric.Body.prototype = {
|
||||
|
||||
this.preRotation = this.rotation;
|
||||
|
||||
if (this._reset || this.sprite._cache[4] === 1) {
|
||||
if (this._reset || this.sprite.fresh === true) {
|
||||
this.prev.x = this.position.x;
|
||||
this.prev.y = this.position.y;
|
||||
this.prev.z = this.position.z;
|
||||
|
||||
Reference in New Issue
Block a user