Skip to content

Commit

Permalink
fix gui stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Aug 4, 2023
1 parent ff1cd6d commit de5c395
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>☔ rain.run</title>
<script type="module">import init from './satrunner-302642d34d68fe7.js';init('./satrunner-302642d34d68fe7_bg.wasm');</script>
<script type="module">import init from './satrunner-97f64ddd025fac7b.js';init('./satrunner-97f64ddd025fac7b_bg.wasm');</script>


<style>
Expand All @@ -17,8 +17,8 @@
}
</style>

<link rel="preload" href="./satrunner-302642d34d68fe7_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-302642d34d68fe7.js"></head>
<link rel="preload" href="./satrunner-97f64ddd025fac7b_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-97f64ddd025fac7b.js"></head>

<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ async function __wbg_init(input) {
if (wasm !== undefined) return wasm;

if (typeof input === 'undefined') {
input = new URL('satrunner-302642d34d68fe7_bg.wasm', import.meta.url);
input = new URL('satrunner-97f64ddd025fac7b_bg.wasm', import.meta.url);
}
const imports = __wbg_get_imports();

Expand Down
Binary file not shown.
12 changes: 12 additions & 0 deletions src/game_core/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,18 @@ pub fn game_over(
if player.score == 21 {
ui.label("Challenge Complete! 🏆");
}
let seconds = player.death_time.unwrap();
let minutes = seconds / 60;

for mut text in query_text.iter_mut() {
text.sections[0].value = format!(
"{:02}/21\n({:02}:{:02})\n{}",
player.score,
minutes % 60,
seconds % 60,
player.name
);
}
if ui.button("Play Again").clicked() {
match network_stuff
.write
Expand Down

0 comments on commit de5c395

Please sign in to comment.