Skip to content

Commit

Permalink
refactor: define initializeBallAndBar as an unexported func
Browse files Browse the repository at this point in the history
  • Loading branch information
canalun committed Feb 25, 2024
1 parent 1d23a80 commit 96f9fa8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/game/initializeBallAndBar.ts

This file was deleted.

15 changes: 14 additions & 1 deletion src/game/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { initializeBall } from "./ball"
import { initializeBar } from "./bar"
import { getBlocks } from "./blocks"
import { freezePage } from "./freezePage"
import { initializeBallAndBar } from "./initializeBallAndBar"
import { initializeScoreboard } from "./initializeScoreboard"
import { msg } from "./message"
import { standby } from "./standby"
Expand All @@ -20,3 +21,15 @@ export function main(options: { withScoreboard: boolean }) {
console.log(e)
}
}

function initializeBallAndBar() {
const ball = initializeBall()
const bar = initializeBar()

const container = document.createElement("div")
document.documentElement.insertAdjacentElement("beforeend", container)
container.insertAdjacentElement("beforeend", ball)
container.insertAdjacentElement("beforeend", bar)

return { ball, bar }
}

0 comments on commit 96f9fa8

Please sign in to comment.