diff --git a/src/game.odin b/src/game.odin index e4e9305..c0bbd4c 100644 --- a/src/game.odin +++ b/src/game.odin @@ -4,6 +4,7 @@ import rl "vendor:raylib" Game :: struct { assets: Asset_Manager, + player: Player } game_init :: proc() -> Game { @@ -12,12 +13,11 @@ game_init :: proc() -> Game { rl.InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE) rl.SetTargetFPS(60) - // sub systems - game.assets = asset_manager_init() + // inits + game.assets = asset_manager_init() + game.player = player_init(&game.assets.player) - if DEBUG_MODE { - rl.TraceLog(.INFO, "Game initialized") - } + if DEBUG_MODE do rl.TraceLog(.INFO, "Game initialized") return game } @@ -27,9 +27,7 @@ game_should_run :: proc(game: ^Game) -> bool { } game_update :: proc(game: ^Game) { - if rl.IsMouseButtonPressed(.LEFT) { - log_info("Mouse Clicked") - } + update_player(&game.player, &game.assets.player) } game_draw :: proc(game: ^Game) { @@ -38,9 +36,10 @@ game_draw :: proc(game: ^Game) { // Do Draw Calls here rl.ClearBackground(rl.DARKGRAY) - if DEBUG_MODE { - rl.DrawFPS(20, 20) - } + if DEBUG_MODE do rl.DrawFPS(20, 20) + + // Renderer calls + renderer_draw_player(&game.player) rl.EndDrawing() } @@ -50,4 +49,4 @@ game_close :: proc(game: ^Game) { asset_manager_destroy(&game.assets) rl.CloseWindow() -} \ No newline at end of file +}