chore: http -> web

This commit is contained in:
cha0s 2022-03-22 20:43:16 -05:00
parent 50cca7bb9f
commit 5a1f85ecd9
34 changed files with 48 additions and 48 deletions

View File

@ -99,7 +99,7 @@ export default (flecks) => class Behaved extends decorate(Trait) {
this.#daemons = Object.values(await this.constructor.loadScripts(daemons, this.#context)); this.#daemons = Object.values(await this.constructor.loadScripts(daemons, this.#context));
this.#routines = await this.constructor.loadScripts(this.params.routines, this.#context); this.#routines = await this.constructor.loadScripts(this.params.routines, this.#context);
this.updateCurrentRoutine(this.state.currentRoutine); this.updateCurrentRoutine(this.state.currentRoutine);
super.isBehaving = 'http' !== process.env.FLECKS_CORE_BUILD_TARGET; super.isBehaving = 'web' !== process.env.FLECKS_CORE_BUILD_TARGET;
} }
methods() { methods() {

View File

@ -37,7 +37,7 @@ export default (Trait, flecks) => class DialogInitiator extends Trait {
...super.methods(), ...super.methods(),
openDialog: async (text) => { openDialog: async (text) => {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
const {Entity} = flecks.get('$avocado/resource.resources'); const {Entity} = flecks.get('$avocado/resource.resources');
if (!this.entity.list) { if (!this.entity.list) {
return; return;

View File

@ -36,7 +36,7 @@ export default (flecks) => {
async load(json) { async load(json) {
await super.load(json); await super.load(json);
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.entity.node.className = 'dialog'; this.entity.node.className = 'dialog';
const {text} = this.entity; const {text} = this.entity;
if (text) { if (text) {
@ -81,7 +81,7 @@ export default (flecks) => {
} }
tick(elapsed) { tick(elapsed) {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.#nextLetter -= elapsed; this.#nextLetter -= elapsed;
if (this.#nextLetter <= 0) { if (this.#nextLetter <= 0) {
this.#thisLetter += 1; this.#thisLetter += 1;

View File

@ -51,7 +51,7 @@ export default (flecks) => {
entity.emit('addedToList'); entity.emit('addedToList');
entity.once('destroying', () => this.onEntityDestroying(entity)); entity.once('destroying', () => this.onEntityDestroying(entity));
this.emit('entityAdded', entity); this.emit('entityAdded', entity);
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.#informedEntities.set(entity, []); this.#informedEntities.set(entity, []);
} }
this.startSynchronizing(entity); this.startSynchronizing(entity);
@ -158,7 +158,7 @@ export default (flecks) => {
return; return;
} }
this.stopSynchronizing(entity); this.stopSynchronizing(entity);
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.#informedEntities.delete(entity); this.#informedEntities.delete(entity);
} }
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign

View File

@ -15,7 +15,7 @@ import hotEntities from '../hot-entities';
const debug = D('@avocado/entity'); const debug = D('@avocado/entity');
let numericUid = 'http' !== process.env.FLECKS_CORE_BUILD_TARGET ? 1 : 1000000000; let numericUid = 'web' !== process.env.FLECKS_CORE_BUILD_TARGET ? 1 : 1000000000;
export default (flecks) => { export default (flecks) => {
const decorate = compose( const decorate = compose(

View File

@ -42,7 +42,7 @@ export default (flecks) => class Alive extends decorate(Trait) {
static defaultParams() { static defaultParams() {
return { return {
deathCheck: 'return entity.life <= 0', deathCheck: 'return entity.life <= 0',
deathScript: `if ('http' === FLECKS_CORE_BUILD_TARGET) { deathScript: `if ('web' === FLECKS_CORE_BUILD_TARGET) {
await TickingPromise.all([ await TickingPromise.all([
entity.playSound("deathSound"), entity.playSound("deathSound"),
entity.transition( entity.transition(
@ -159,7 +159,7 @@ export default (flecks) => class Alive extends decorate(Trait) {
} }
tick() { tick() {
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
if (!this.#isDying) { if (!this.#isDying) {
this.#deathCheck.evaluate(({value: died}) => { this.#deathCheck.evaluate(({value: died}) => {
if (died) { if (died) {

View File

@ -90,7 +90,7 @@ export default () => class DomNode extends decorate(Trait) {
async load(json) { async load(json) {
await super.load(json); await super.load(json);
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.entity.node = window.document.createElement('entity'); this.entity.node = window.document.createElement('entity');
Object.entries(this.params.style).forEach(([key, value]) => { Object.entries(this.params.style).forEach(([key, value]) => {
this.entity.node.style[key] = value; this.entity.node.style[key] = value;
@ -100,7 +100,7 @@ export default () => class DomNode extends decorate(Trait) {
} }
tick() { tick() {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET && this.#scheduledRuleApplication) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET && this.#scheduledRuleApplication) {
this.#scheduledRuleApplication = false; this.#scheduledRuleApplication = false;
this.applyStyleRules(); this.applyStyleRules();
} }

View File

@ -6,7 +6,7 @@ export default () => class DomText extends Trait {
constructor() { constructor() {
super(); super();
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.#text = window.document.createElement('span'); this.#text = window.document.createElement('span');
} }
} }

View File

@ -50,7 +50,7 @@ export default () => class Positioned extends decorate(Trait) {
this.trackedPosition = [x, y]; this.trackedPosition = [x, y];
this.entity.position[0] = x; this.entity.position[0] = x;
this.entity.position[1] = y; this.entity.position[1] = y;
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.serverPosition = this.trackedPosition; this.serverPosition = this.trackedPosition;
this.serverPositionDirty = false; this.serverPositionDirty = false;
} }
@ -59,7 +59,7 @@ export default () => class Positioned extends decorate(Trait) {
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
onTrackedPositionChanged(oldPosition, newPosition) { onTrackedPositionChanged(oldPosition, newPosition) {
[this.entity.position[0], this.entity.position[1]] = newPosition; [this.entity.position[0], this.entity.position[1]] = newPosition;
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
[this.state.x, this.state.y] = newPosition; [this.state.x, this.state.y] = newPosition;
this.markAsDirty(); this.markAsDirty();
} }

View File

@ -36,7 +36,7 @@ describe('Alive', () => {
it('exists', async () => { it('exists', async () => {
expect(entity.is('Alive')).to.be.true; expect(entity.is('Alive')).to.be.true;
}); });
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
it('can die', async () => { it('can die', async () => {
let isDying = false; let isDying = false;
entity.once('startedDying', () => { entity.once('startedDying', () => {
@ -53,7 +53,7 @@ describe('Alive', () => {
entity.maxLife = 50; entity.maxLife = 50;
expect(entity.life).to.equal(50); expect(entity.life).to.equal(50);
}); });
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
it('can have a custom death condition', async () => { it('can have a custom death condition', async () => {
const entity = await Entity.load({ const entity = await Entity.load({
traits: { traits: {
@ -116,7 +116,7 @@ describe('Alive', () => {
expect(entity2.life).to.equal(80); expect(entity2.life).to.equal(80);
expect(entity2.maxLife).to.equal(90); expect(entity2.maxLife).to.equal(90);
}); });
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
it('generates and accepts death packets', async () => { it('generates and accepts death packets', async () => {
entity.life = 0; entity.life = 0;
entity.tick(); entity.tick();

View File

@ -35,7 +35,7 @@ describe('Positioned', () => {
it('exists', async () => { it('exists', async () => {
expect(entity.is('Positioned')).to.be.true; expect(entity.is('Positioned')).to.be.true;
}); });
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
it('generates and accepts movement packets', async () => { it('generates and accepts movement packets', async () => {
entity.setPosition([1, 1]); entity.setPosition([1, 1]);
const packets = entity.trait('Positioned').packetsFor(); const packets = entity.trait('Positioned').packetsFor();

View File

@ -13,7 +13,7 @@ export default class Canvas extends decorate(Class) {
constructor(size = [0, 0]) { constructor(size = [0, 0]) {
super(); super();
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
// eslint-disable-next-line global-require // eslint-disable-next-line global-require
const {RenderTexture, Texture} = require('@pixi/core'); const {RenderTexture, Texture} = require('@pixi/core');
this.renderTexture = RenderTexture.create(); this.renderTexture = RenderTexture.create();

View File

@ -12,7 +12,7 @@ export default class Container extends Renderable {
constructor() { constructor() {
super(); super();
this.$$children = []; this.$$children = [];
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
// eslint-disable-next-line global-require // eslint-disable-next-line global-require
const {Container: PIXIContainer} = require('@pixi/display'); const {Container: PIXIContainer} = require('@pixi/display');
this.container = new PIXIContainer(); this.container = new PIXIContainer();

View File

@ -40,7 +40,7 @@ export default class Image extends Resource {
async load(buffer, uri) { async load(buffer, uri) {
if (buffer) { if (buffer) {
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
const {height, width} = imageSize(Buffer.from(buffer)); const {height, width} = imageSize(Buffer.from(buffer));
this.texture = { this.texture = {
height, height,

View File

@ -1,4 +1,4 @@
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
const [ const [
{SCALE_MODES}, {Renderer, BatchRenderer}, {settings}, {SCALE_MODES}, {Renderer, BatchRenderer}, {settings},
] = [ ] = [

View File

@ -14,7 +14,7 @@ export default class Primitives extends Renderable {
constructor() { constructor() {
super(); super();
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
// eslint-disable-next-line global-require // eslint-disable-next-line global-require
const {Graphics} = require('@pixi/graphics'); const {Graphics} = require('@pixi/graphics');
this.primitives = new Graphics(); this.primitives = new Graphics();

View File

@ -3,7 +3,7 @@ import {Vector} from '@avocado/math';
export default class Renderer { export default class Renderer {
constructor(size = [0, 0]) { constructor(size = [0, 0]) {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
// eslint-disable-next-line global-require // eslint-disable-next-line global-require
const {Renderer: PIXIRenderer} = require('@pixi/core'); const {Renderer: PIXIRenderer} = require('@pixi/core');
this.renderer = new PIXIRenderer({ this.renderer = new PIXIRenderer({

View File

@ -5,7 +5,7 @@ export default class Sprite extends Renderable {
constructor(image) { constructor(image) {
super(); super();
this.$$image = image; this.$$image = image;
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
// eslint-disable-next-line global-require // eslint-disable-next-line global-require
const {Sprite: PIXISprite} = require('@pixi/sprite'); const {Sprite: PIXISprite} = require('@pixi/sprite');
this.sprite = new PIXISprite(image.texture); this.sprite = new PIXISprite(image.texture);

View File

@ -6,7 +6,7 @@ export default class Text extends Renderable {
constructor(text, style) { constructor(text, style) {
super(); super();
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
// eslint-disable-next-line global-require // eslint-disable-next-line global-require
const {Text: PIXIText} = require('@pixi/text'); const {Text: PIXIText} = require('@pixi/text');
const pixiText = new PIXIText(text, style); const pixiText = new PIXIText(text, style);

View File

@ -18,7 +18,7 @@ export default (flecks) => {
constructor() { constructor() {
super(); super();
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.#container = new Container(); this.#container = new Container();
this.#container.on('parentChanged', this.onParentChanged, this); this.#container.on('parentChanged', this.onParentChanged, this);
} }
@ -91,7 +91,7 @@ export default (flecks) => {
async load(json) { async load(json) {
await super.load(json); await super.load(json);
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
if (this.#container) { if (this.#container) {
this.#container.alpha = this.entity.opacity; this.#container.alpha = this.entity.opacity;
this.#container.rotation = this.entity.rotation; this.#container.rotation = this.entity.rotation;

View File

@ -46,7 +46,7 @@ export default class InputNormalizer extends decorate(Class) {
if (this.target) { if (this.target) {
return; return;
} }
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
Gamepads.start(); Gamepads.start();
Gamepads.addEventListener('connect', this.onGamepadConnect); Gamepads.addEventListener('connect', this.onGamepadConnect);
Gamepads.addEventListener('disconnect', this.onGamepadDisconnect); Gamepads.addEventListener('disconnect', this.onGamepadDisconnect);

View File

@ -62,7 +62,7 @@ export default () => class Controllable extends decorate(Trait) {
.invokeHookFlat('acceptAction', actionStream[i]) .invokeHookFlat('acceptAction', actionStream[i])
.every((result) => false !== result) .every((result) => false !== result)
) { ) {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.#queued.push(actionStream[i]); this.#queued.push(actionStream[i]);
} }
} }
@ -83,7 +83,7 @@ export default () => class Controllable extends decorate(Trait) {
} }
tick() { tick() {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
const drained = this.#actionRegistry.drain(); const drained = this.#actionRegistry.drain();
this.entity.acceptActionStream(drained); this.entity.acceptActionStream(drained);
} }

View File

@ -16,7 +16,7 @@ export default () => class Initiator extends Trait {
constructor() { constructor() {
super(); super();
this.#ticker.on('tick', this.determineTarget, this); this.#ticker.on('tick', this.determineTarget, this);
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.#adjustmentThrobber = {brightness: 1.5}; this.#adjustmentThrobber = {brightness: 1.5};
this.#adjustmentThrobber.lfo = new LfoResult( this.#adjustmentThrobber.lfo = new LfoResult(
this.#adjustmentThrobber, this.#adjustmentThrobber,
@ -93,7 +93,7 @@ export default () => class Initiator extends Trait {
return { return {
acceptAction: ({action, value}) => { acceptAction: ({action, value}) => {
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
if ('Interact' === action && value) { if ('Interact' === action && value) {
if (this.#target) { if (this.#target) {
this.#target.interact(this.entity); this.#target.interact(this.entity);
@ -109,7 +109,7 @@ export default () => class Initiator extends Trait {
targetChanged(oldTarget) { targetChanged(oldTarget) {
oldTarget?.container?.removeFilter('interactive', 'adjustment'); oldTarget?.container?.removeFilter('interactive', 'adjustment');
oldTarget?.container?.removeFilter('interactive', 'glow'); oldTarget?.container?.removeFilter('interactive', 'glow');
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
this.#adjustmentThrobber.lfo.properties.brightness.location = 0; this.#adjustmentThrobber.lfo.properties.brightness.location = 0;
this.#adjustmentThrobber.lfo.tick(0); this.#adjustmentThrobber.lfo.tick(0);
this.#glowThrobber.lfo.properties.outerStrength.location = 0; this.#glowThrobber.lfo.properties.outerStrength.location = 0;

View File

@ -235,7 +235,7 @@ export default (flecks) => class Collider extends decorate(Trait) {
} }
tick() { tick() {
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.checkActiveCollision(); this.checkActiveCollision();
} }
} }

View File

@ -187,7 +187,7 @@ export default (flecks) => class Emitter extends decorate(Trait) {
}, },
json, json,
); );
if (transmit && 'http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if (transmit && 'web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.#emitting.push(augmentedJson); this.#emitting.push(augmentedJson);
this.markAsDirty(); this.markAsDirty();
} }

View File

@ -27,7 +27,7 @@ export default () => class Physical extends decorate(Trait) {
body.setCollisionForEntity(this.entity); body.setCollisionForEntity(this.entity);
world.addBody(body); world.addBody(body);
this.#body = body; this.#body = body;
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
if (this.entity.is('Visible') && this.params.isDebugging) { if (this.entity.is('Visible') && this.params.isDebugging) {
this.#bodyView = new BodyView(body); this.#bodyView = new BodyView(body);
this.#bodyView.position = Vector.scale(this.entity.position, -1); this.#bodyView.position = Vector.scale(this.entity.position, -1);

View File

@ -38,7 +38,7 @@ export default () => class Shaped extends decorate(Trait) {
return { return {
traitAdded: () => { traitAdded: () => {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
if (this.entity.is('Visible') && this.params.isDebugging) { if (this.entity.is('Visible') && this.params.isDebugging) {
if (!this.#shapeView) { if (!this.#shapeView) {
this.#shapeView = new ShapeView(this.entity.shape); this.#shapeView = new ShapeView(this.entity.shape);

View File

@ -2,7 +2,7 @@ export const bufferify = (value) => Buffer.from(JSON.stringify(value));
export const parse = (buffer) => { export const parse = (buffer) => {
let string; let string;
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
const decoder = new TextDecoder(); const decoder = new TextDecoder();
string = decoder.decode(buffer); string = decoder.decode(buffer);
} }

View File

@ -54,7 +54,7 @@ export default class Resource extends decorate(Class) {
} }
try { try {
let resource; let resource;
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
const response = await window.fetch(join('/', this.root, uri)); const response = await window.fetch(join('/', this.root, uri));
if (!response.ok) { if (!response.ok) {
throw new Error('Not found'); throw new Error('Not found');

View File

@ -1,4 +1,4 @@
import Client from './client'; import Client from './client';
import Server from './server'; import Server from './server';
export default process.env.FLECKS_CORE_BUILD_TARGET === 'http' ? Client : Server; export default process.env.FLECKS_CORE_BUILD_TARGET === 'web' ? Client : Server;

View File

@ -45,7 +45,7 @@ const pull = () => {
setTimeout(pull, Math.max(20, hmi + hmi * (Math.random() - 0.5))); setTimeout(pull, Math.max(20, hmi + hmi * (Math.random() - 0.5)));
}; };
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
setTimeout(pull, MAX_INTERVAL); setTimeout(pull, MAX_INTERVAL);
} }
@ -57,7 +57,7 @@ export default class Sound extends JsonResource {
await super.load(json); await super.load(json);
const {volume = 1} = json; const {volume = 1} = json;
const src = json.src || json.uri.replace('.sound.json', '.wav'); const src = json.src || json.uri.replace('.sound.json', '.wav');
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.#audio = new FakeAudio(); this.#audio = new FakeAudio();
return; return;
} }
@ -91,7 +91,7 @@ export default class Sound extends JsonResource {
} }
play() { play() {
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
play(this.#audio, this.uri); play(this.#audio, this.uri);
} }
} }

View File

@ -88,7 +88,7 @@ export default () => class Audible extends Trait {
// eslint-disable-next-line no-empty // eslint-disable-next-line no-empty
catch (error) {} catch (error) {}
} }
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
Promise.resolve(this.#sounds[key]).then((sound) => { Promise.resolve(this.#sounds[key]).then((sound) => {
debug('Playing %s', key); debug('Playing %s', key);
sound.play(); sound.play();

View File

@ -9,7 +9,7 @@ export default class AnimationView extends Container {
constructor(animation) { constructor(animation) {
super(); super();
this.animation = animation; this.animation = animation;
if ('http' === process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' === process.env.FLECKS_CORE_BUILD_TARGET) {
if (this.animation.imageUri) { if (this.animation.imageUri) {
Image.load(this.animation.imageUri).then((image) => { Image.load(this.animation.imageUri).then((image) => {
this.sprite = new Sprite(image); this.sprite = new Sprite(image);

View File

@ -209,7 +209,7 @@ export default (flecks) => {
return; return;
} }
this.#data[index] = tile; this.#data[index] = tile;
if ('http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.#updates.push([[x, y], [1, 1], [tile]]); this.#updates.push([[x, y], [1, 1], [tile]]);
this.#hasUpdates = true; this.#hasUpdates = true;
} }
@ -268,7 +268,7 @@ export default (flecks) => {
sx -= w; sx -= w;
sy += 1; sy += 1;
} }
if (isDirty && 'http' !== process.env.FLECKS_CORE_BUILD_TARGET) { if (isDirty && 'web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
this.#updates.push([[x, y], [w, h], tiles]); this.#updates.push([[x, y], [w, h], tiles]);
this.#hasUpdates = true; this.#hasUpdates = true;
} }