Compare commits
4 Commits
f5cc26a048
...
c9cb24281b
| Author | SHA1 | Date | |
|---|---|---|---|
| c9cb24281b | |||
| 0ebefb4776 | |||
| 8c38cbdb90 | |||
| 109a0077ca |
@ -38,4 +38,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8724979, -0.2644562)
|
||||
|
||||
[node name="name_label" type="Label3D" parent="." unique_id=142179925]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.3304863, 0)
|
||||
pixel_size = 0.002
|
||||
billboard = 1
|
||||
text = "asd"
|
||||
font_size = 64
|
||||
|
||||
@ -176,7 +176,7 @@ pub struct Game {
|
||||
player_counter: u16,
|
||||
pub self_id: Option<u16>,
|
||||
pub players: Vec<Player>,
|
||||
game_started: bool,
|
||||
pub game_started: bool,
|
||||
|
||||
pub current_map: Option<Gd<Map>>,
|
||||
pub world_ball: Option<Gd<Ball>>,
|
||||
@ -299,6 +299,8 @@ impl Game {
|
||||
}
|
||||
|
||||
pub fn finish_game(&mut self) {
|
||||
self.game_started = false;
|
||||
|
||||
for player in &mut self.players {
|
||||
if let Some(mut character) = player.character.take() {
|
||||
character.queue_free();
|
||||
@ -320,7 +322,6 @@ impl Game {
|
||||
ball.queue_free();
|
||||
}
|
||||
self.current_map.take();
|
||||
self.game_started = false;
|
||||
|
||||
self.run_deferred(|s| {
|
||||
if let Some(peer) = &mut NetworkManager::singleton().bind_mut().peer
|
||||
|
||||
@ -436,8 +436,8 @@ impl ICharacterBody3D for LocalPlayer {
|
||||
let input_direction = if self.locked {
|
||||
let input = Input::singleton();
|
||||
|
||||
if self.base().is_on_floor() && input.is_action_just_pressed("jump") {
|
||||
self.try_jump();
|
||||
if input.is_action_just_pressed("jump") {
|
||||
self.jump();
|
||||
}
|
||||
|
||||
Vector3::RIGHT * input.is_action_pressed("right") as u32 as f32
|
||||
@ -530,7 +530,11 @@ impl ICharacterBody3D for LocalPlayer {
|
||||
}
|
||||
|
||||
fn exit_tree(&mut self) {
|
||||
self.set_lock(false);
|
||||
if let Some(game) = Game::singleton()
|
||||
&& !game.bind().game_started
|
||||
{
|
||||
self.set_lock(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +36,7 @@ impl IHBoxContainer for SimpleScoreView {
|
||||
.on_goal()
|
||||
.connect_other(s, |s| s.update_goals());
|
||||
}
|
||||
s.update_goals();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user