Shrinkage

This commit is contained in:
Silas Bartha 2022-04-03 14:39:14 -04:00
parent 614822d464
commit 3ed57a17e7
No known key found for this signature in database
GPG Key ID: 9323054A4EA1EA6C
2 changed files with 12 additions and 1 deletions

View File

@ -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()
]
} }
} }

View File

@ -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);
} }