From 30c3886afbd566b0e1d9e7fad2f4c88d81cc29ac Mon Sep 17 00:00:00 2001 From: Jason Hilder Date: Thu, 10 Sep 2026 07:43:01 +0200 Subject: [PATCH] Improved naming and cleaned up game struct. --- src/game.odin | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/game.odin b/src/game.odin index 0de74e5..385fd91 100644 --- a/src/game.odin +++ b/src/game.odin @@ -2,19 +2,17 @@ package game import rl "vendor:raylib" -// good 16:9 internal res, window scales up to 1080/4k clean. -VIEWPORT_WIDTH :: 1280 -VIEWPORT_HEIGHT :: 720 -WINDOW_WIDTH :: 2560 -WINDOW_HEIGHT :: 1440 -WINDOW_TITLE :: "Pong" +// 16:9 internal res, window scales up to 1080/4k etc +VIEWPORT_W :: 1280 +VIEWPORT_H :: 720 +WINDOW_W :: 2560 +WINDOW_H :: 1440 +WINDOW_TITLE :: "Pong" Game :: struct { viewport: rl.RenderTexture2D, scene: Scene, paused: bool, - score_player: int, - score_enemy: int, } // ------------------------------------------------------------------------------ @@ -23,21 +21,15 @@ Game :: struct { // ------------------------------------------------------------------------------ game_init :: proc(game: ^Game) { // Window configs - rl.InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE) + rl.InitWindow(WINDOW_W, WINDOW_H, WINDOW_TITLE) rl.SetTargetFPS(60) // initial state - game.score_player = 0 - game.score_enemy = 0 - game.paused = false + game.viewport = rl.LoadRenderTexture(VIEWPORT_W, VIEWPORT_H) + game.paused = false - game.viewport = rl.LoadRenderTexture(VIEWPORT_WIDTH, VIEWPORT_HEIGHT) // initial scene (should be menu when setup) game.scene = init_gameplay_scene() - - // init any systems/managers - // game.input_manager = .... - // game.audio_manager = .... } // ------------------------------------------------------------------------------