Shrinkage
This commit is contained in:
parent
614822d464
commit
3ed57a17e7
@ -1,11 +1,14 @@
|
|||||||
use nalgebra as na;
|
use nalgebra as na;
|
||||||
|
|
||||||
|
use raylib::prelude::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug)]
|
||||||
pub struct Player {
|
pub struct Player {
|
||||||
pub position: na::Vector2<f32>,
|
pub position: na::Vector2<f32>,
|
||||||
pub velocity: na::Vector2<f32>,
|
pub velocity: na::Vector2<f32>,
|
||||||
pub size: f32,
|
pub size: f32,
|
||||||
|
pub active_texture: i32,
|
||||||
|
pub textures: [String; 3],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Player {
|
impl Player {
|
||||||
@ -16,6 +19,12 @@ impl Player {
|
|||||||
position,
|
position,
|
||||||
velocity: na::Vector2::zeros(),
|
velocity: na::Vector2::zeros(),
|
||||||
size: 1.0,
|
size: 1.0,
|
||||||
|
active_texture: 0,
|
||||||
|
textures: [
|
||||||
|
"assets/chr/chr_cubee/chr_cubeeLarge.png".to_string(),
|
||||||
|
"assets/chr/chr_cubee/chr_cubeeMedium.png".to_string(),
|
||||||
|
"assets/chr/chr_cubee/chr_cubeeSmall.png".to_string()
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,6 +197,8 @@ impl PlayableScene {
|
|||||||
|
|
||||||
player.position += velocity_modifier;
|
player.position += velocity_modifier;
|
||||||
|
|
||||||
|
player.size -= 0.001;
|
||||||
|
|
||||||
self.update_camera(raylib);
|
self.update_camera(raylib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user