update example

This commit is contained in:
Alexander Popov 2023-04-30 17:47:06 +03:00
parent c52b91c007
commit e5b1498955
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6

View File

@ -1,6 +1,4 @@
import { App } from './app.js';
import { Scene, SceneLayer } from './scene.js';
import { Rect, StrokeRect, Sprite } from './objects.js';
import { App, Scene, SceneLayer, Rect, StrokeRect, Sprite } from './engine.js';
// init player
let Player = {
@ -21,14 +19,14 @@ let layerBg = new SceneLayer('background', [
]);
let layerHud = new SceneLayer('hud', [
new Sprite('compass.png', 15, 15),
new Sprite('compass-arrow.png', 27, 21),
new Sprite('/assets/compass.png', 15, 15),
new Sprite('/assets/compass-arrow.png', 27, 21),
]);
let layerInstances = new SceneLayer('Instances', [Player.rect], { debug: true });
// init app
let app = new App(document.querySelector('canvas'), 400, 400);
let app = new App(400, 400);
// init scene
let firstScene = new Scene(app.canvas, app.context, 400, 400);