Get old demo running

This commit is contained in:
Tangent Wantwight 2020-01-19 01:24:29 -05:00
parent 105ab7af03
commit 5fed6ea82f
6 changed files with 1399 additions and 1358 deletions

2730
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,14 +4,16 @@
"description": "Sacrifices must be made",
"private": true,
"scripts": {
"build": "webpack",
"buildProduction": "webpack --mode=production",
"build": "parcel build src/index.html",
"clean": "rimraf .cache dist",
"live": "parcel src/index.html",
"tsc:check": "tsc --noEmit"
},
"author": "Tangent 128",
"license": "ISC",
"devDependencies": {
"parcel-bundler": "^1.12.4",
"rimraf": "^3.0.0",
"sass": "^1.23.7",
"typescript": "^3.7.3"
}

View file

@ -111,7 +111,8 @@ export class LoopTest {
const layer = new Layer(0);
const drawSet = new DrawSet();
const spinnerId = Create(this.data, {
// spinner box
Create(this.data, {
location: new Location({
X: 200,
Y: 200,
@ -125,10 +126,12 @@ export class LoopTest {
)
});
const triangleId = Create(this.data, {
// triangles
[0, 1, 2, 3, 4, 5].forEach(angle => Create(this.data, {
location: new Location({
X: 200,
Y: 200,
Angle: angle,
VAngle: -Math.PI/10
}),
bounds: new Polygon([70, 0, 55, 40, 85, 40]),
@ -137,16 +140,19 @@ export class LoopTest {
"#d40",
layer
)
});
}));
const loop = new Loop(30,
interval => {
DumbMotion(this.data, interval);
const [triangleDebug] = Lookup(this.data, triangleId, "renderBounds");
if(triangleDebug) triangleDebug.color = "#d40";
Join(this.data, "collisionSourceClass", "renderBounds").forEach(([collisionSourceClass, renderBounds]) => {
if(collisionSourceClass.name === "tri") {
renderBounds.color = "#d40";
}
});
FindCollisions(this.data, 500, (className, sourceId, targetId) => {
FindCollisions(this.data, 500, (className, sourceId, _targetId) => {
switch(className) {
case "tri>block":
const [debug] = Lookup(this.data, sourceId, "renderBounds");

1
src/Game/Main.ts Normal file
View file

@ -0,0 +1 @@
import {} from "./GameComponents";

View file

@ -4,6 +4,7 @@
<title></title>
<link rel="stylesheet" href="./index.scss" />
</head><body>
<canvas id="RenderTest" width="500" height="400"></canvas>
<canvas id="GameCanvas" width="500" height="400"></canvas>
<script src="./index.ts"></script>
</body></html>

View file

@ -1 +1,2 @@
import "./Game/Main";
import "./Ecs/test";