fix transponder positioning
This commit is contained in:
parent
2014ad42c8
commit
e759e0ddbe
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"end_position": {
|
"end_position": {
|
||||||
"x": 350.0,
|
"x": 350.0,
|
||||||
"y": 2100.0
|
"y": 2050.0
|
||||||
},
|
},
|
||||||
"player_spawn": {
|
"player_spawn": {
|
||||||
"x": 220.0,
|
"x": 220.0,
|
||||||
|
@ -179,11 +179,9 @@ impl Screen for InGameScreen {
|
|||||||
{
|
{
|
||||||
let mut context_2d = draw_handle.begin_mode2D(game_core.master_camera);
|
let mut context_2d = draw_handle.begin_mode2D(game_core.master_camera);
|
||||||
|
|
||||||
|
|
||||||
// Clear frame
|
// Clear frame
|
||||||
context_2d.clear_background(Color::BLACK);
|
context_2d.clear_background(Color::BLACK);
|
||||||
|
|
||||||
|
|
||||||
// Render the world
|
// Render the world
|
||||||
self.render_world(&mut context_2d, game_core, dt);
|
self.render_world(&mut context_2d, game_core, dt);
|
||||||
if game_core.show_simple_debug_info {
|
if game_core.show_simple_debug_info {
|
||||||
@ -210,16 +208,12 @@ impl Screen for InGameScreen {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Render transponder
|
||||||
// Render transponder
|
game_core.resources.transponder.draw(
|
||||||
game_core.resources.transponder.draw(&mut context_2d, game_core.world.end_position + Vector2::new(0.0, -50.0), 0.0);
|
&mut context_2d,
|
||||||
|
game_core.world.end_position,
|
||||||
|
0.0,
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Render Player
|
// Render Player
|
||||||
game_core
|
game_core
|
||||||
@ -261,9 +255,14 @@ impl Screen for InGameScreen {
|
|||||||
return Some(GameState::GameEnd);
|
return Some(GameState::GameEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if game_core.world.end_position.distance_to(game_core.player.position) <= 70.0{
|
if game_core
|
||||||
return Some(GameState::WinGame);
|
.world
|
||||||
}
|
.end_position
|
||||||
|
.distance_to(game_core.player.position)
|
||||||
|
<= 70.0
|
||||||
|
{
|
||||||
|
return Some(GameState::WinGame);
|
||||||
|
}
|
||||||
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user