From b3d9ffe8107bd7e0989c1fed2e5bdf31037134bb Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 5 Jun 2022 20:38:18 -0500 Subject: begin adding logical map shapes --- src/main.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/main.js') diff --git a/src/main.js b/src/main.js index 0474d7a..5c6db59 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,23 @@ -import { LayerData, LayerView, LayerController } from './Map/Layer.js'; +import { Transform, Canvas } from './Map/Canvas.js'; +import { Node, Shape, Point, Path, Polygon } from './Map/Shapes.js'; -const view = new LayerView('root'); -const data = new LayerData(); -const con = new LayerController(data, view); +function point(x, y) { this.x = x; this.y = y; }; + +const canvas = new Canvas('root'); +const transform = new Transform(); + +const shapes = [ + new Point(new Node(30, 30)), + new Path([ + new Node(100, 100), + new Node(100, 200), + new Node(150, 250), + ]), + new Polygon([ + new Node(200, 100), + new Node(200, 200), + new Node(300, 200), + ]), +]; + +canvas.render(transform, shapes); -- cgit v1.2.1