diff --git a/src/main.ts b/src/main.ts index fe99b54..171b1fc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,7 @@ import { AnimationEngine } from "./engine"; import { MovementSystem, FrictionSystem } from "./systems"; // Specialized Systems and Entities -import { MouseForceSystem, DOMUpdateSystem, DOMMouseDragHandler } from "./dom"; +import { MouseForceSystem, DOMUpdateSystem } from "./dom"; import { BoxEntity, AnchorEntity } from "./entities"; import { SpringEntity, SpringPhysicsSystem } from "./spring"; import { ChartSystem } from "./chart"; @@ -25,7 +25,6 @@ const anchorEntity = new AnchorEntity({ x: 100, y: 100 }, "anchor"); // Create a spring entity that connects box1 and anchor const springEntity = new SpringEntity(boxEntity, anchorEntity, 0.2, 0.05, 1.0); -springEntity.name = "spring"; // Create second box entity const boxElement2 = document.getElementById("box2") as HTMLElement; @@ -33,7 +32,6 @@ const boxEntity2 = new BoxEntity(boxElement2, { x: 250, y: 100 }, "box2"); // Creating the spring force connecting box and box2 const springEntity2 = new SpringEntity(boxEntity, boxEntity2, 0.2, 0.05, 2.0); -springEntity2.name = "spring2"; // Create third box entity const boxElement3 = document.getElementById("box3") as HTMLElement; @@ -41,7 +39,6 @@ const boxEntity3 = new BoxEntity(boxElement3, { x: 400, y: 100 }, "box3"); // Creating the spring force connecting box2 and box3 const springEntity3 = new SpringEntity(boxEntity2, boxEntity3, 0.1, 0.05, 1.0); -springEntity3.name = "spring3"; // // --- Systems --- @@ -96,7 +93,7 @@ if (chartContext) { engine.start(); // TODO -// -[ ] Prepare specific entities kinds (anchor, box, etc). The components should be added in the constructor like the spring, this minimizes the amount of components to add manually to an entity. +// -[x] Prepare specific entities kinds (anchor, box, etc). The components should be added in the constructor like the spring, this minimizes the amount of components to add manually to an entity. // -[ ] Cleanup creation examples, it's easy to forget to add entities to the engine if not added right after creation. // -[ ] Take initial and drop velocity into account // -[ ] Attach multiple entities to the spring force. Make a cloth like simulation.