diff --git a/src/Game/GameObject/GameObject.js b/src/Game/GameObject/GameObject.js new file mode 100644 index 0000000..0b7e833 --- /dev/null +++ b/src/Game/GameObject/GameObject.js @@ -0,0 +1,45 @@ +import * as PIXI from "../../pixi/pixi.mjs" + +/** + * Base class for all game objects. + * Contains only necessary functions + */ +export class GameObject { + + id = -1; + tickEnabled = true; + // markedAsWaitingForDestruction = false; + // markedAsInitialized = false; + + /** + * GameObject id + * @param {Number} id + * @param {Boolean} tickAble + */ + constructor(id, tickAble) + { + this.id = id; + this.tickEnabled = tickAble; + }; + + /** + * called before object's destruction + */ + preDestroy(){}; + + /** + * called after spawn + */ + afterSpawn(){}; + + /** + * called before spawn + */ + preSpawn(){}; + + /** + * called every frame + * @param {PIXI.Ticker} ticker + */ + tick(ticker){}; +}; \ No newline at end of file diff --git a/src/Game/Sound/Sound.js b/src/Game/Sound/Sound.js index 4fd3459..1c32515 100644 --- a/src/Game/Sound/Sound.js +++ b/src/Game/Sound/Sound.js @@ -61,6 +61,7 @@ let nightAmbientSoundCue = new NumberCue( ); export function handleSounds(tick) { + // console.log(tick); let p = getDayPhase(); ambientDay.volume(dayAmbientSoundCue.getValueAt(p) * globalSoundVolume * ambientSoundVolume * 0.6); ambientNight.volume(nightAmbientSoundCue.getValueAt(p) * globalSoundVolume * ambientSoundVolume * 0.6);