first steps with refs

This commit is contained in:
2023-11-27 19:21:10 +01:00
parent 227e44dd43
commit 677acf771a
6 changed files with 198 additions and 23 deletions

View File

@@ -6,13 +6,11 @@ mod game;
mod player;
mod level;
mod position;
mod monster;
fn main() {
let mut p = Player::new("Teddy Tester", 10);
let g = Game {
player: &mut p,
levels: Vec::new()
};
let g = Game::new(&mut p);
println!("{}",g.player.get_name());
println!("{}",g.player.get_life());