More cleanup

This commit is contained in:
2026-04-29 22:39:47 -05:00
parent 61f69af35a
commit ffed626447
14 changed files with 473 additions and 247 deletions
+19 -21
View File
@@ -1,28 +1,26 @@
var Cube = include('entities/cube.js');
var cam;
var cube;
function CubeScene() {
this.cam = new Entity();
this.cam.add(POSITION);
this.cam.position.x = 3;
this.cam.position.y = 3;
this.cam.position.z = 3;
this.cam.position.lookAt(0, 0, 0);
this.cam.add(CAMERA);
var SceneCube = {
init: function() {
cam = Entity.create();
cam.add(COMPONENT_TYPE_POSITION);
cam.position.x = 3;
cam.position.y = 3;
cam.position.z = 3;
cam.position.lookAt(0, 0, 0);
cam.add(COMPONENT_TYPE_CAMERA);
cube = Cube.create();
},
this.cube = new Cube();
}
update: function() {
cube.update();
},
Object.assign(CubeScene, Scene.prototype);
dispose: function() {
cam.dispose();
cube.dispose();
}
CubeScene.prototype.update = function() {
this.cube.update();
};
SceneCube;
CubeScene.prototype.dispose = function() {
this.cam.dispose();
this.cube.dispose();
};
module = CubeScene;