From 17d6165d439e743d7f302736532fb9c01a110e74 Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Sat, 19 Oct 2024 07:43:09 -0300 Subject: [PATCH] single main.rs --- src/main.rs | 24 +++++++++++++++++++++--- src/player.rs | 17 ----------------- 2 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 src/player.rs diff --git a/src/main.rs b/src/main.rs index 7714f12..d00e8c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,29 @@ use color_eyre::Result; -use macroquad::{audio::{self, PlaySoundParams}, prelude::*}; -use player::Player; +use macroquad::{ + audio::{self, PlaySoundParams}, + prelude::*, +}; extern crate rand; use rand::Rng; -mod player; +struct Player { + x: f32, + y: f32, + score: i16, + steps: i16, +} + +impl Player { + fn new(x: f32, y: f32) -> Player { + Player { + x, + y, + score: 0, + steps: 0, + } + } +} // Util functions fn rand_gold_position() -> u32 { diff --git a/src/player.rs b/src/player.rs deleted file mode 100644 index 7ee2fa8..0000000 --- a/src/player.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub struct Player { - pub x: f32, - pub y: f32, - pub score: i16, - pub steps: i16, -} - -impl Player { - pub fn new(x: f32, y: f32) -> Player { - Player { - x, - y, - score: 0, - steps: 0, - } - } -}