| 123456789101112131415161718192021222324252627282930313233343536 |
- import { coordinates } from "./coordinates.js";
- import { actor } from "./actor.js";
- import { render_engine } from "./render-engine.js"
- class scene {
- #canvas;
- #player;
- #engine;
- constructor() {
- this.#player = new actor();
- this.#canvas = document.createElement("canvas");
- const context = this.#canvas.getContext("webgl2");
- if (!context) {
- throw new TypeError("Browser does not support WebGL.");
- }
- this.#engine = new render_engine(this.#canvas, context, this.#player);
- this.#canvas.classList.add("space-render");
- }
- get player() {
- return this.#player;
- }
- get canvas() {
- return this.#canvas;
- }
- run() {
- this.#engine.run();
- }
- }
- export { scene };
|