diff options
Diffstat (limited to 'src/engine.js')
-rw-r--r-- | src/engine.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/engine.js b/src/engine.js index a7bb8a5..1d71148 100644 --- a/src/engine.js +++ b/src/engine.js @@ -2,18 +2,19 @@ import { start, update, draw } from "./main.js" import { Screen } from "./engine/screen.js" import { keys, setUpKeyboard } from "./engine/keyboard.js" import { startClock } from "./engine/clock.js" +import { Radio } from "./engine/radio.js" +import { Collision } from "./engine/collision.js" export class Engine { static frame = 0 - static audio static screen = new Screen() + static radio = new Radio() + static collision = new Collision() static keys = keys - static bgm static startEngine() { setUpKeyboard() start() - startClock() } @@ -22,13 +23,7 @@ export class Engine { draw() } - static playSound(file) { - let audio = new Audio(file) - audio.play() - } - - static playMusic(file) { - this.bgm = new Audio(file) - this.bgm.play() + static random(min, max) { + return Math.floor(Math.random() * (max + 1 - min) + min); } } |