|
|
@ -11,25 +11,20 @@ import androidx.compose.web.css.Style |
|
|
|
import org.jetbrains.compose.web.ui.Styles |
|
|
|
import org.jetbrains.compose.web.ui.Styles |
|
|
|
|
|
|
|
|
|
|
|
class JsGame : Game() { |
|
|
|
class JsGame : Game() { |
|
|
|
override fun saveTime() { |
|
|
|
override fun now() = window.performance.now().toLong() |
|
|
|
previousTime = window.performance.now().toLong() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun main() { |
|
|
|
fun main() { |
|
|
|
val root = document.getElementById("root") as HTMLElement |
|
|
|
val root = document.getElementById("root") as HTMLElement |
|
|
|
|
|
|
|
|
|
|
|
renderComposable( |
|
|
|
renderComposable(root = root) { |
|
|
|
root = root |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
Style(Styles) |
|
|
|
Style(Styles) |
|
|
|
fallingBalls( |
|
|
|
val game = remember { |
|
|
|
remember { |
|
|
|
JsGame().apply { |
|
|
|
JsGame()?.apply { |
|
|
|
|
|
|
|
width = root.offsetWidth |
|
|
|
width = root.offsetWidth |
|
|
|
height = root.offsetHeight |
|
|
|
height = root.offsetHeight |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
fallingBalls(game) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|