world rendering
This commit is contained in:
parent
360dd59ca9
commit
07acb6335b
@ -31,7 +31,21 @@ impl InGameScreen {
|
||||
context_2d: &mut RaylibMode2D<RaylibDrawHandle>,
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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")?,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user