36 lines
676 B
JavaScript
36 lines
676 B
JavaScript
var Player = require('./Player.js');
|
|
var PlayerCamera = require('./PlayerCamera.js');
|
|
var TestPlane = require('./TestPlane.js');
|
|
|
|
class OverworldScene {
|
|
constructor() {
|
|
this.time = 0;
|
|
}
|
|
|
|
init() {
|
|
this.player = new Player();
|
|
this.plane = new TestPlane();
|
|
this.camera = new PlayerCamera(this.player);
|
|
}
|
|
|
|
update() {
|
|
this.camera.update();
|
|
|
|
this.time += Time.delta;
|
|
if(this.time > 3.0) {
|
|
Scene.set(new OverworldScene());
|
|
}
|
|
}
|
|
|
|
dispose() {
|
|
this.camera.dispose();
|
|
this.player.dispose();
|
|
this.plane.dispose();
|
|
|
|
this.camera = null;
|
|
this.player = null;
|
|
this.plane = null;
|
|
}
|
|
}
|
|
|
|
module.exports = OverworldScene; |