From 25adfc618e77db9a5ee3b98ce0dab0be832efed0 Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Tue, 24 Dec 2024 17:58:20 +0100 Subject: hello kitty base done --- src/engine.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/engine.js') 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); } } -- cgit v1.2.3