diff options
author | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-24 17:58:20 +0100 |
---|---|---|
committer | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-24 17:58:20 +0100 |
commit | 25adfc618e77db9a5ee3b98ce0dab0be832efed0 (patch) | |
tree | 36ca56758ddd4674ab5a43df4b76bbfcc5a47af1 /src/engine.js | |
parent | a840990bdcabf45fb0d377478ba0ab27222434ae (diff) |
hello kitty base done
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); } } |