More cleanup
This commit is contained in:
+19
-21
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user