Testing cutscenes

This commit is contained in:
2026-05-05 22:10:47 -05:00
parent 3bc544fba1
commit 6da02b25fa
14 changed files with 786 additions and 2 deletions
+12 -2
View File
@@ -1,4 +1,5 @@
var CubeEntity = include('entities/CubeEntity.js');
var MoveCubeCutscene = include('cutscenes/MoveCubeCutscene.js');
function CubeScene() {
this.cam = new Entity();
@@ -13,17 +14,26 @@ function CubeScene() {
this.spriteEnt = new Entity();
this.spriteEnt.add(POSITION);
this.spriteEnt.position.position = new Vec3(16, 16, 0);
// this.spriteEnt.sprite.setTexture('ui/minogram.png');
this.inputEnabled = false;
var scene = this;
Cutscene.play(new MoveCubeCutscene({ cube: this.cube })).then(function() {
scene.inputEnabled = true;
});
}
CubeScene.prototype = Object.create(Scene.prototype);
CubeScene.prototype.constructor = CubeScene;
CubeScene.prototype.update = function() {
this.cube.update();
if(this.inputEnabled) {
this.cube.update();
}
};
CubeScene.prototype.dispose = function() {
Cutscene.stop();
this.cam.dispose();
this.cube.dispose();
this.spriteEnt.dispose();