Gating network behind compile flag
This commit is contained in:
@@ -1,26 +1,36 @@
|
||||
// Copyright (c) 2026 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
var Player = require('./Player.js');
|
||||
var PlayerCamera = require('./PlayerCamera.js');
|
||||
var TestPlane = require('./TestPlane.js');
|
||||
|
||||
var camera = null;
|
||||
|
||||
module.exports = {
|
||||
init: function() {
|
||||
var player = new Player();
|
||||
new TestPlane();
|
||||
camera = new PlayerCamera(player);
|
||||
},
|
||||
|
||||
update: function() {
|
||||
if(camera) camera.update();
|
||||
},
|
||||
|
||||
dispose: function() {
|
||||
camera = null;
|
||||
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;
|
||||
Reference in New Issue
Block a user