Small refactor and rename of struct field.

This commit is contained in:
2026-07-21 06:22:32 +02:00
parent 48612116ec
commit d072c56ca5
4 changed files with 32 additions and 25 deletions
+11 -4
View File
@@ -13,10 +13,12 @@ Tile_Type :: enum {
}
Game_Map :: struct {
width: int,
height: int,
tile_size: int,
data: [400]int
width: int,
height: int,
width_px: f32,
height_px: f32,
data: [400]int
}
Grid_Pos :: [2]int
@@ -47,12 +49,17 @@ map_init :: proc() -> Game_Map {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
}
return Game_Map{
game := Game_Map{
width = 20,
height = 20,
tile_size = TILE_SIZE,
data = map_data,
}
game.width_px = f32(game.width * game.tile_size)
game.height_px = f32(game.height * game.tile_size)
return game
}
// requires raw window-space