Skip to content

Commit

Permalink
add respawn changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Aug 7, 2023
1 parent c2d51d6 commit 6af6f9b
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 55 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-208b84db2b9f8b89.js';init('./satrunner-208b84db2b9f8b89_bg.wasm');</script>
<script type="module">import init from './satrunner-d5c164f05f1dd05.js';init('./satrunner-d5c164f05f1dd05_bg.wasm');</script>


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

<link rel="preload" href="./satrunner-208b84db2b9f8b89_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-208b84db2b9f8b89.js"></head>
<link rel="preload" href="./satrunner-d5c164f05f1dd05_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-d5c164f05f1dd05.js"></head>

<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,20 @@ function __wbg_get_imports() {
const ret = getObject(arg0).createBuffer(arg1 >>> 0, arg2 >>> 0, arg3);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbg_close_dfa389d8fddb52fc = function() { return handleError(function (arg0) {
getObject(arg0).close();
}, arguments) };
imports.wbg.__wbg_newwitheventinitdict_1f554ee93659ab92 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = new CloseEvent(getStringFromWasm0(arg0, arg1), getObject(arg2));
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbg_dispatchEvent_a622a6455be582eb = function() { return handleError(function (arg0, arg1) {
const ret = getObject(arg0).dispatchEvent(getObject(arg1));
return ret;
}, arguments) };
imports.wbg.__wbg_removeEventListener_5de660c02ed784e4 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
}, arguments) };
imports.wbg.__wbg_new_b66404b6322c59bf = function() { return handleError(function (arg0, arg1) {
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
Expand All @@ -1106,20 +1120,6 @@ function __wbg_get_imports() {
const ret = false;
return ret;
};
imports.wbg.__wbg_close_dfa389d8fddb52fc = function() { return handleError(function (arg0) {
getObject(arg0).close();
}, arguments) };
imports.wbg.__wbg_newwitheventinitdict_1f554ee93659ab92 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = new CloseEvent(getStringFromWasm0(arg0, arg1), getObject(arg2));
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbg_dispatchEvent_a622a6455be582eb = function() { return handleError(function (arg0, arg1) {
const ret = getObject(arg0).dispatchEvent(getObject(arg1));
return ret;
}, arguments) };
imports.wbg.__wbg_removeEventListener_5de660c02ed784e4 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
}, arguments) };
imports.wbg.__wbg_readyState_b25418fd198bf715 = function(arg0) {
const ret = getObject(arg0).readyState;
return ret;
Expand Down Expand Up @@ -1885,64 +1885,64 @@ function __wbg_get_imports() {
imports.wbg.__wbg_cancelAnimationFrame_9b68e9588c6543bc = function() { return handleError(function (arg0, arg1) {
getObject(arg0).cancelAnimationFrame(arg1);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper2730 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper2743 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 213, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37373 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37389 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37378 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2373, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37394 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2374, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37382 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2373, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37398 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2374, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37385 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2373, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37401 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2374, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37388 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2373, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37404 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2374, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37391 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2373, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37407 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2374, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37394 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2373, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37410 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2374, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper37559 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper37575 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38886 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper38902 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38889 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_34);
imports.wbg.__wbindgen_closure_wrapper38905 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38891 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper38907 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper38894 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper38910 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper42813 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_34);
imports.wbg.__wbindgen_closure_wrapper42830 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper44079 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2371, __wbg_adapter_37);
imports.wbg.__wbindgen_closure_wrapper44077 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2372, __wbg_adapter_37);
return addHeapObject(ret);
};

Expand Down Expand Up @@ -1986,7 +1986,7 @@ async function __wbg_init(input) {
if (wasm !== undefined) return wasm;

if (typeof input === 'undefined') {
input = new URL('satrunner-208b84db2b9f8b89_bg.wasm', import.meta.url);
input = new URL('satrunner-d5c164f05f1dd05_bg.wasm', import.meta.url);
}
const imports = __wbg_get_imports();

Expand Down
Binary file not shown.
19 changes: 11 additions & 8 deletions src/game_core/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,21 @@ pub fn game_over(
mut contexts: EguiContexts,
mut player_name: ResMut<PlayerName>,
mut network_stuff: ResMut<NetworkStuff>,
mut query_player: Query<(&mut Transform, &mut Player, &mut Sprite)>,
mut query_player: Query<(&Transform, &mut Player, &mut Sprite)>,
mut next_state: ResMut<NextState<GameStage>>,
mut query_text: Query<&mut Text, With<NamePlatesLocal>>,
objects: Res<Objects>,
client_tick: Res<ClientTick>,
) {
if client_tick.tick.unwrap_or(0) % 100 == 0 {
for (_, mut player, _) in query_player.iter_mut() {
let input = PlayerInput::new([0.0, 0.0], player.id, client_tick.tick.unwrap());
for (transform, mut player, _) in query_player.iter_mut() {
let input = PlayerInput::new(
transform.translation.truncate().into(),
player.id,
client_tick.tick.unwrap(),
);

info!("Sending input: {:?}", input);

player.name = player_name.name.clone();

Expand All @@ -272,7 +278,7 @@ pub fn game_over(
.collapsible(false)
.anchor(egui::Align2::CENTER_TOP, egui::Vec2::ZERO)
.show(ctx, |ui| {
for (mut transform, mut player, mut sprite) in query_player.iter_mut() {
for (transform, mut player, mut sprite) in query_player.iter_mut() {
egui::Area::new("area")
.anchor(egui::Align2::CENTER_CENTER, egui::Vec2::new(0.0, 120.0))
.show(ctx, |ui| {
Expand Down Expand Up @@ -310,12 +316,9 @@ pub fn game_over(
next_state.set(GameStage::InGame);
}
});

player.target = transform.translation.truncate();
player_name.submitted = false;
sprite.color = Color::GRAY;
player.target = Vec2::ZERO;
player.pending_inputs.clear();
transform.translation = Vec3::new(0.0, -150.0, 0.1);
});
ui.label("High Scores");
ui.label(format!(
Expand Down

0 comments on commit 6af6f9b

Please sign in to comment.