pub startpos
This commit is contained in:
@@ -13,6 +13,7 @@ mod camera;
|
|||||||
mod collision;
|
mod collision;
|
||||||
mod obstacle;
|
mod obstacle;
|
||||||
mod player;
|
mod player;
|
||||||
|
mod score;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ use crate::collision::{Collider, HasCollided};
|
|||||||
const FALL_SPEED: f32 = 300.0; // Falling speed
|
const FALL_SPEED: f32 = 300.0; // Falling speed
|
||||||
const DIVE_SPEED: f32 = 700.0; // Falling speed sped up
|
const DIVE_SPEED: f32 = 700.0; // Falling speed sped up
|
||||||
const HORIZONTAL_SPEED: f32 = 300.0; // Lateral movement speed
|
const HORIZONTAL_SPEED: f32 = 300.0; // Lateral movement speed
|
||||||
const START_POSITION: Vec3 = Vec3::new(0.0, 0.0, 2.0); // Start position
|
pub const START_POSITION: Vec3 = Vec3::new(0.0, 0.0, 2.0); // Start position
|
||||||
|
|
||||||
// The player
|
// The player
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
use crate::player::{Player, START_POSITION};
|
||||||
|
|
||||||
|
#[derive(Resource)]
|
||||||
|
pub struct Depth(pub f32);
|
||||||
|
|
||||||
|
fn update_depth(mut depth: ResMut<Depth>, player: Single<&Transform, With<Player>>) {
|
||||||
|
depth.0 = START_POSITION.y - player.translation.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn spawn_depth_text() {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update_depth_text() {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user