Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Sep 13, 2024
1 parent 1750b23 commit 6df032c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/components/app.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect, useMemo, useState } from "preact/hooks";
import { useEffect, useState } from "preact/hooks";
import { IngameView } from "./ingame-view";
import { Menu } from "./menu";
import { loadAssets } from "../assets";

export function App() {
const [gameState, setGameState] = useState<{}>();
const [gameState, setGameState] = useState<Record<string, never>>();
const [assetProgress, setAssetProgress] = useState(0);
const [assetsLoaded, setAssetsLoaded] = useState(false);

Expand All @@ -20,7 +20,7 @@ export function App() {
}
if (gameState) {
return <IngameView />
};
}

return <Menu onNewGame={() => setGameState({})}/>
}
4 changes: 1 addition & 3 deletions src/entities/bitmapTerrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export class BitmapTerrain implements IMatterEntity {
const after = context.getImageData(snapshotX,snapshotY, snapshotWidth, snapshotHeight);

// See what has changed, hopefully a red cricle!
let diffPixels = 0;
for (let i = 0; i < before.data.length; i += 4) {
const oldDataValue = before.data[i]+before.data[i+1]+before.data[i+2]+before.data[i+3];
const newDataValue = after.data[i]+after.data[i+1]+after.data[i+2]+after.data[i+3];
Expand All @@ -162,7 +161,6 @@ export class BitmapTerrain implements IMatterEntity {
after.data[i+1] = 0;
after.data[i+2] = 0;
after.data[i+3] = 0;
diffPixels++;
}
}

Expand Down Expand Up @@ -219,7 +217,7 @@ export class BitmapTerrain implements IMatterEntity {
// Can we go to the next x point without falling?
let closestTerrainPoint: Vector|undefined;

let rejectedPoints: Body[] = [];
const rejectedPoints: Body[] = [];

for (const terrain of filteredPoints) {
const terrainPoint = terrain.position;
Expand Down
2 changes: 1 addition & 1 deletion src/entities/explosion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Explosion implements IGameEntity {
kind,
})

};
}
this.gfx = new Graphics({ position: Vector.clone(point)});
this.timer = Ticker.targetFPMS * this.explosionMs;
this.radiusExpandBy = initialRadius * 0.2;
Expand Down
2 changes: 1 addition & 1 deletion src/entities/phys/bazookaShell.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Container, Graphics, Rectangle, Sprite, Texture } from 'pixi.js';
import { Container, Graphics, Sprite, Texture } from 'pixi.js';
import grenadePaths from "../../assets/bazooka.svg";
import { Body, Bodies, Composite, Vector } from "matter-js";
import { TimedExplosive } from "./timedExplosive";
Expand Down
2 changes: 1 addition & 1 deletion src/entities/phys/grenade.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Container, Sprite, Text, Texture, Ticker } from 'pixi.js';
import grenadePaths from "../../assets/grenade.svg";
import { Body, Bodies, Composite, Vector } from "matter-js";
import { Bodies, Composite, Vector } from "matter-js";
import { TimedExplosive } from "./timedExplosive";
import { IMatterEntity } from '../entity';
import { BitmapTerrain } from '../bitmapTerrain';
Expand Down
2 changes: 1 addition & 1 deletion src/entities/water.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Composite, Body, Bodies } from "matter-js";
import { Container, Filter, Geometry, GlProgram, Mesh, Shader, UPDATE_PRIORITY } from "pixi.js";
import { Container, Filter, Geometry, Mesh, Shader, UPDATE_PRIORITY } from "pixi.js";
import { IGameEntity } from "./entity";
import vertex from '../shaders/water.vert?raw';
import fragment from '../shaders/water.frag?raw';
Expand Down
3 changes: 1 addition & 2 deletions src/game.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import "pathseg";
import { Application, Assets, UPDATE_PRIORITY, Text, Ticker } from 'pixi.js';
import { Application, UPDATE_PRIORITY, Text, Ticker } from 'pixi.js';
import { BazookaShell } from './entities/phys/bazookaShell';
import { Explosion } from './entities/explosion';
import { Grenade } from './entities/phys/grenade';
import { IGameEntity, IMatterEntity } from './entities/entity';
import { manifest } from './assets/manifest';
import { QuadtreeDetector } from './quadtreeDetector';
import { Worm } from './entities/phys/worm';
import * as polyDecomp from 'poly-decomp-es';
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/bodyWireframe..ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Body } from "matter-js";
import { Graphics, Rectangle } from "pixi.js";
import { Graphics } from "pixi.js";

/**
* Render a wireframe in pixi.js around a matter body.
Expand Down

0 comments on commit 6df032c

Please sign in to comment.