diff --git a/src/logic/mod.rs b/src/logic/mod.rs index 19c7044..7b1e5eb 100644 --- a/src/logic/mod.rs +++ b/src/logic/mod.rs @@ -4,4 +4,4 @@ pub mod mainmenu; pub mod pausemenu; pub mod ingame; pub mod gameend; -pub mod shopscreen; \ No newline at end of file +pub mod shop; \ No newline at end of file diff --git a/src/logic/shopscreen.rs b/src/logic/shop/mod.rs similarity index 99% rename from src/logic/shopscreen.rs rename to src/logic/shop/mod.rs index 7bae2d5..5cf2458 100644 --- a/src/logic/shopscreen.rs +++ b/src/logic/shop/mod.rs @@ -36,7 +36,7 @@ impl ShopScreen { // Title draw_handle.draw_text( "SHOP", - bounds.x as i32 + 30, + bounds.x as i32 + (bounds.width / 2.0) as i32 - 50, bounds.y as i32 + 20, 40, Color::BLACK, diff --git a/src/main.rs b/src/main.rs index a98eed6..a8a260f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,19 +1,22 @@ +mod entities; mod gamecore; +mod items; mod lib; mod logic; -mod resources; -mod player; -mod world; mod pallette; -mod entities; -mod items; +mod player; +mod resources; +mod world; use gamecore::{GameCore, GameProgress, GameState}; use lib::{utils::profiler::GameProfiler, wrappers::audio::player::AudioPlayer}; use log::info; -use logic::{gameend::GameEndScreen, ingame::InGameScreen, loadingscreen::LoadingScreen, mainmenu::MainMenuScreen, pausemenu::PauseMenuScreen, screen::Screen, shopscreen::ShopScreen}; +use logic::{ + gameend::GameEndScreen, ingame::InGameScreen, loadingscreen::LoadingScreen, + mainmenu::MainMenuScreen, pausemenu::PauseMenuScreen, screen::Screen, shop::ShopScreen, +}; use raylib::prelude::*; -use world::{World, load_world_colliders}; +use world::{load_world_colliders, World}; // Game Launch Configuration const DEFAULT_WINDOW_DIMENSIONS: Vector2 = Vector2 { @@ -32,7 +35,8 @@ fn main() { .size( DEFAULT_WINDOW_DIMENSIONS.x as i32, DEFAULT_WINDOW_DIMENSIONS.y as i32, - ).msaa_4x() + ) + .msaa_4x() .title(WINDOW_TITLE) .build(); raylib.set_target_fps(MAX_FPS); @@ -41,8 +45,13 @@ fn main() { raylib.set_exit_key(None); // Load the world - let world_colliders = load_world_colliders("./assets/img/map/cave.json".to_string()).expect("Failed to load world colliders"); - let world = World::load_from_json("./assets/worlds/mainworld.json".to_string(), world_colliders).expect("Failed to load main world JSON"); + let world_colliders = load_world_colliders("./assets/img/map/cave.json".to_string()) + .expect("Failed to load world colliders"); + let world = World::load_from_json( + "./assets/worlds/mainworld.json".to_string(), + world_colliders, + ) + .expect("Failed to load main world JSON"); // Load the game progress let game_progress = GameProgress::try_from_file("./assets/savestate.json".to_string());