move control constants to constants.odin

This commit is contained in:
2026-06-28 00:46:28 -07:00
parent d29b4f07ea
commit 2c4527ae8b
2 changed files with 23 additions and 21 deletions
+23
View File
@@ -48,3 +48,26 @@ ENEMY_LABEL_COLOR :: rl.Color{255, 200, 200, 255}
STARTING_BASE_HEALTH :: 20
STARTING_GOLD :: 100
//controls constants
BOTTOM_BAR_Y :: SCREEN_H - CONTROL_BAR_H
ARCHER_BUTTON_W :: 120
START_WAVE_BUTTON_W :: 110
CONTROLS_BUTTON_GAP :: 12
CONTROLS_BUTTON_H :: 24
CONTROLS_BUTTON_Y :: BOTTOM_BAR_Y + 8
CONTROLS_BUTTON_X :: (SCREEN_W - (ARCHER_BUTTON_W + CONTROLS_BUTTON_GAP + START_WAVE_BUTTON_W)) / 2
ARCHER_BUTTON_RECT :: rl.Rectangle {
f32(CONTROLS_BUTTON_X),
f32(CONTROLS_BUTTON_Y),
ARCHER_BUTTON_W,
CONTROLS_BUTTON_H,
}
START_WAVE_BUTTON_RECT :: rl.Rectangle {
f32(CONTROLS_BUTTON_X + ARCHER_BUTTON_W + CONTROLS_BUTTON_GAP),
f32(CONTROLS_BUTTON_Y),
START_WAVE_BUTTON_W,
CONTROLS_BUTTON_H,
}
-21
View File
@@ -3,27 +3,6 @@ package game
import "core:fmt"
import rl "vendor:raylib"
BOTTOM_BAR_Y :: SCREEN_H - CONTROL_BAR_H
ARCHER_BUTTON_W :: 120
START_WAVE_BUTTON_W :: 110
CONTROLS_BUTTON_GAP :: 12
CONTROLS_BUTTON_H :: 24
CONTROLS_BUTTON_Y :: BOTTOM_BAR_Y + 8
CONTROLS_BUTTON_X :: (SCREEN_W - (ARCHER_BUTTON_W + CONTROLS_BUTTON_GAP + START_WAVE_BUTTON_W)) / 2
ARCHER_BUTTON_RECT :: rl.Rectangle {
f32(CONTROLS_BUTTON_X),
f32(CONTROLS_BUTTON_Y),
ARCHER_BUTTON_W,
CONTROLS_BUTTON_H,
}
START_WAVE_BUTTON_RECT :: rl.Rectangle {
f32(CONTROLS_BUTTON_X + ARCHER_BUTTON_W + CONTROLS_BUTTON_GAP),
f32(CONTROLS_BUTTON_Y),
START_WAVE_BUTTON_W,
CONTROLS_BUTTON_H,
}
poll_controls_command :: proc(world: ^World) -> Command {
if world.phase != .Build do return Command{kind = .None}