react-simple-game-engine 0.2.129 → 0.2.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/classes/entities/entity.d.ts +2 -2
- package/lib/classes/entities/entity.d.ts.map +1 -1
- package/lib/classes/entities/entity.js +6 -5
- package/lib/classes/sensor.d.ts +5 -2
- package/lib/classes/sensor.d.ts.map +1 -1
- package/lib/classes/sensor.js +6 -1
- package/lib/classes/world-management.d.ts.map +1 -1
- package/lib/classes/world-management.js +15 -0
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import Matter from "matter-js";
|
2
2
|
import { Sprite } from "../sprites/sprite";
|
3
|
-
import { CreateBodyDefine, EntityInitial, EntityPrepare, MasterBody, Point } from "../../export-types";
|
3
|
+
import { Color, CreateBodyDefine, EntityInitial, EntityPrepare, MasterBody, Point } from "../../export-types";
|
4
4
|
import { EntitySult } from "./entity-sult";
|
5
5
|
import { LogicComponent } from "../logic-component";
|
6
6
|
import { Sound } from "../sound";
|
@@ -67,7 +67,7 @@ export declare abstract class Entity<P extends Record<string, any> = Record<stri
|
|
67
67
|
*/
|
68
68
|
onTimer(interval: number, job: TimerJobListener, { defaultRun, once, startFrom, onRegisterDone, }?: TimerOptions): () => void;
|
69
69
|
removeSensor(sensor: Sensor): void;
|
70
|
-
addSensor({ position, name, shape, width, height, radius
|
70
|
+
addSensor({ position, name, shape, width, height, radius }: AddSensorParams, debug?: boolean, debugColor?: Color): void;
|
71
71
|
createBody(enabledPhysicBody: boolean, transform: CreateBodyDefine["transform"], options?: CreateBodyDefine["bodyOptions"]): MasterBody | {
|
72
72
|
position: Point;
|
73
73
|
entity: Entity<Record<string, any>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/classes/entities/entity.ts"],"names":[],"mappings":"AAAA,OAAO,MAAwB,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,MAAM,EA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AgB,CAAC,aAAa,CAAC;;;;IAW3C,SAAS,CAAC,QAAQ,CAAC,YAAY,CAC7B,iBAAiB,EAAE,OAAO,EAC1B,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,EACxC,OAAO,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,GACxC,MAAM,CAAC,IAAI,GAAG;QAAE,QAAQ,EAAE,KAAK,CAAA;KAAE;IAEpC,OAAO,CAAC,EACN,SAAS,EACT,MAAM,EAAE,eAAe,EACvB,WAAW,EACX,KAAU,EACV,GAAG,MAAM,EACV,EAAE,aAAa,CAAC,IAAI,CAAC;IAmDtB,SAAS,CAAC,QAAQ,CAAC,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC;IAEnD;;;OAGG;IACH,SAAS,CAAC,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC;IAI1C,MAAM;IAgBN;;;OAGG;IACH,QAAQ;IAER,IAAI;IAOJ;;;OAGG;IACH,MAAM;IAEN,QAAQ,CAAC,oBAAoB,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAElE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IACnC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IACtC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAEzC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IACzD,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAC5D,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;CAChE"}
|
@@ -161,20 +161,21 @@ var Entity = /** @class */ (function (_super) {
|
|
161
161
|
this.worldManagement.removeBody(sensor.body);
|
162
162
|
}
|
163
163
|
};
|
164
|
-
Entity.prototype.addSensor = function (_a) {
|
164
|
+
Entity.prototype.addSensor = function (_a, debug, debugColor) {
|
165
165
|
var position = _a.position, name = _a.name, _b = _a.shape, shape = _b === void 0 ? "rect" : _b, width = _a.width, height = _a.height, radius = _a.radius;
|
166
|
+
if (debug === void 0) { debug = false; }
|
166
167
|
name = name || genId();
|
167
168
|
var pos = position || __assign({}, this.position);
|
168
169
|
var sensor;
|
169
170
|
if (shape === "rect") {
|
170
|
-
sensor = new Sensor(this, name, shape, Bodies.rectangle(pos.x, pos.y, width, height, {
|
171
|
+
sensor = new Sensor(this, name, { width: width, height: height }, shape, Bodies.rectangle(pos.x, pos.y, width, height, {
|
171
172
|
isSensor: true,
|
172
|
-
}));
|
173
|
+
}), debug, debugColor);
|
173
174
|
}
|
174
175
|
else {
|
175
|
-
sensor = new Sensor(this, name, shape, Bodies.circle(pos.x, pos.y, radius, {
|
176
|
+
sensor = new Sensor(this, name, { width: radius * 2, height: radius * 2 }, shape, Bodies.circle(pos.x, pos.y, radius, {
|
176
177
|
isSensor: true,
|
177
|
-
}));
|
178
|
+
}), debug, debugColor);
|
178
179
|
}
|
179
180
|
this.sensors.push(sensor);
|
180
181
|
this.worldManagement.addBody(sensor.body);
|
package/lib/classes/sensor.d.ts
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
import { SensorBody } from "../export-types";
|
1
|
+
import { Color, SensorBody, Size } from "../export-types";
|
2
2
|
import { Entity } from "./entities/entity";
|
3
3
|
export declare class Sensor {
|
4
4
|
readonly entity: Entity;
|
5
5
|
readonly name: string;
|
6
|
+
readonly size: Size;
|
6
7
|
readonly shape: "rect" | "circle";
|
7
8
|
readonly body: SensorBody;
|
8
|
-
|
9
|
+
readonly debug: boolean;
|
10
|
+
readonly debugColor: Color;
|
11
|
+
constructor(entity: Entity, name: string, size: Size, shape: "rect" | "circle", body: SensorBody, debug?: boolean, debugColor?: Color);
|
9
12
|
}
|
10
13
|
//# sourceMappingURL=sensor.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sensor.d.ts","sourceRoot":"","sources":["../../src/classes/sensor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"sensor.d.ts","sourceRoot":"","sources":["../../src/classes/sensor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,qBAAa,MAAM;aAEC,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,IAAI;aACV,KAAK,EAAE,MAAM,GAAG,QAAQ;aACxB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,OAAO;aACd,UAAU,EAAE,KAAK;gBANjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,GAAG,QAAQ,EACxB,IAAI,EAAE,UAAU,EAChB,KAAK,GAAE,OAAe,EACtB,UAAU,GAAE,KAA4B;CAK3D"}
|
package/lib/classes/sensor.js
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
var Sensor = /** @class */ (function () {
|
2
|
-
function Sensor(entity, name, shape, body) {
|
2
|
+
function Sensor(entity, name, size, shape, body, debug, debugColor) {
|
3
|
+
if (debug === void 0) { debug = false; }
|
4
|
+
if (debugColor === void 0) { debugColor = [212, 200, 200, 100]; }
|
3
5
|
this.entity = entity;
|
4
6
|
this.name = name;
|
7
|
+
this.size = size;
|
5
8
|
this.shape = shape;
|
6
9
|
this.body = body;
|
10
|
+
this.debug = debug;
|
11
|
+
this.debugColor = debugColor;
|
7
12
|
this.body.sensor = this;
|
8
13
|
this.body.entity = this.entity;
|
9
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"world-management.d.ts","sourceRoot":"","sources":["../../src/classes/world-management.ts"],"names":[],"mappings":"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IAAI;CAiBL"}
|
@@ -204,6 +204,21 @@ var WorldManagement = /** @class */ (function () {
|
|
204
204
|
WorldManagement.prototype.draw = function () {
|
205
205
|
this.iterateEntities(function (entity) {
|
206
206
|
entity.draw();
|
207
|
+
if (entity instanceof Entity) {
|
208
|
+
var _loop_1 = function (sensor) {
|
209
|
+
if (sensor.debug) {
|
210
|
+
var _b = sensor.size, width_1 = _b.width, height_1 = _b.height;
|
211
|
+
Renderer.drawHandle(sensor.body.position, function (renderer) {
|
212
|
+
renderer.fill(sensor.debugColor);
|
213
|
+
renderer.rect(0, 0, width_1, height_1);
|
214
|
+
});
|
215
|
+
}
|
216
|
+
};
|
217
|
+
for (var _i = 0, _a = entity.sensors; _i < _a.length; _i++) {
|
218
|
+
var sensor = _a[_i];
|
219
|
+
_loop_1(sensor);
|
220
|
+
}
|
221
|
+
}
|
207
222
|
});
|
208
223
|
};
|
209
224
|
return WorldManagement;
|