Code formatting cleanup.
This commit is contained in:
+16
-4
@@ -23,10 +23,17 @@ Tile_Def :: struct {
|
|||||||
// awesome odin sets the fixed size to the ammount of enum options
|
// awesome odin sets the fixed size to the ammount of enum options
|
||||||
tile_defs: [Tile_Type]Tile_Def = {
|
tile_defs: [Tile_Type]Tile_Def = {
|
||||||
.FLOOR = { solid = false },
|
.FLOOR = { solid = false },
|
||||||
.WALL = { solid = true, collider_offset_x = 0, collider_offset_y = 0, collider_w = TILE_SIZE, collider_h = TILE_SIZE },
|
|
||||||
.LOW_WALL = { solid = true, collider_offset_x = 0, collider_offset_y = TILE_SIZE/2, collider_w = TILE_SIZE, collider_h = TILE_SIZE/2 },
|
|
||||||
.PICKUP = { solid = false },
|
.PICKUP = { solid = false },
|
||||||
|
.WALL = {
|
||||||
|
solid = true,
|
||||||
|
collider_offset_x = 0, collider_offset_y = 0,
|
||||||
|
collider_w = TILE_SIZE, collider_h = TILE_SIZE
|
||||||
|
},
|
||||||
|
.LOW_WALL = {
|
||||||
|
solid = true,
|
||||||
|
collider_offset_x = 0, collider_offset_y = TILE_SIZE/2,
|
||||||
|
collider_w = TILE_SIZE, collider_h = TILE_SIZE/2
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Game_Map :: struct {
|
Game_Map :: struct {
|
||||||
@@ -147,7 +154,12 @@ check_map_collision :: proc(rect: rl.Rectangle, game_map: Game_Map) -> bool {
|
|||||||
def := tile_defs[tile]
|
def := tile_defs[tile]
|
||||||
|
|
||||||
if def.solid {
|
if def.solid {
|
||||||
tile_rect := get_world_tile_rect( f32(gx), f32(gy), def.collider_offset_x, def.collider_offset_y, def.collider_w, def.collider_h);
|
tile_rect := get_world_tile_rect(
|
||||||
|
f32(gx), f32(gy),
|
||||||
|
def.collider_offset_x, def.collider_offset_y,
|
||||||
|
def.collider_w, def.collider_h
|
||||||
|
);
|
||||||
|
|
||||||
if rl.CheckCollisionRecs(rect, tile_rect) {
|
if rl.CheckCollisionRecs(rect, tile_rect) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user