diff --git a/src/logic/ingame/mod.rs b/src/logic/ingame/mod.rs index 4a4e0a8..59944aa 100644 --- a/src/logic/ingame/mod.rs +++ b/src/logic/ingame/mod.rs @@ -31,7 +31,21 @@ impl InGameScreen { context_2d: &mut RaylibMode2D, game_core: &mut GameCore, ) { - context_2d.draw_circle(0, 0, 10.0, Color::BLACK); + // Build source bounds + let source_bounds = Rectangle { + x: 0.0, + y: 0.0, + width: game_core.resources.cave_mid_layer.width as f32, + height: game_core.resources.cave_mid_layer.height as f32, + }; + + // Render the world texture + context_2d.draw_texture_rec( + &game_core.resources.cave_mid_layer, + source_bounds, + Vector2::zero(), + Color::WHITE, + ); } } diff --git a/src/resources.rs b/src/resources.rs index 7397358..b88c5a4 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -16,6 +16,9 @@ pub struct GlobalResources { pub player_animation_regular: FrameAnimationWrapper, pub player_animation_boost_charge: FrameAnimationWrapper, pub player_animation_boost: FrameAnimationWrapper, + + // Cave + pub cave_mid_layer: Texture2D } impl GlobalResources { @@ -56,6 +59,10 @@ impl GlobalResources { 21, 30, ), + cave_mid_layer: raylib.load_texture_from_image( + &thread, + &Image::load_image("./assets/img/map/cave.png")?, + )?, }) } }