b9d2fe60fd
Extracts Player (extends Entity), TestPlane, and PlayerCamera into their own files; the camera now tracks the player's live position at a fixed offset instead of orbiting the world origin over time. Updates test_overworldscene.c to match the new entity order and to build an in-memory zip fixture, since overworldscene.js now require()s these sibling files and require() always resolves through ASSET.zip.
25 lines
700 B
JavaScript
25 lines
700 B
JavaScript
// Copyright (c) 2026 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
class TestPlane {
|
|
constructor() {
|
|
this.entity = new Entity();
|
|
|
|
this.position = this.entity.add(POSITION);
|
|
this.position.setLocalPosition(-10.0, 0.0, -10.0);
|
|
this.position.setLocalScale(20.0, 1.0, 20.0);
|
|
|
|
this.physics = this.entity.add(PHYSICS);
|
|
this.physics.setBodyType(PHYSICS_BODY_STATIC);
|
|
this.physics.setShape(PHYSICS_SHAPE_PLANE, 0.0, 1.0, 0.0, 0.0);
|
|
|
|
this.renderable = this.entity.add(RENDERABLE);
|
|
this.renderable.setMesh(0, MESH_PLANE);
|
|
this.renderable.setColor(128, 128, 128, 255);
|
|
}
|
|
}
|
|
|
|
module.exports = TestPlane;
|