Added compile time vars for consistency.

This commit is contained in:
2026-10-08 07:48:54 +02:00
parent dda388868c
commit bb35f185b8
+5 -3
View File
@@ -6,14 +6,16 @@ import rl "vendor:raylib"
SPEED_INC :: 30 SPEED_INC :: 30
EFFECTS_SPEED :: 300 EFFECTS_SPEED :: 300
INITIAL_SPEED :: 200
MAX_SPEED :: 550
init_ball :: proc() -> Entity { init_ball :: proc() -> Entity {
return Entity{ return Entity{
type = .Ball, type = .Ball,
active = true, active = true,
pos = rl.Vector2{(VIEWPORT_W / 2), (VIEWPORT_H / 2)}, pos = rl.Vector2{(VIEWPORT_W / 2), (VIEWPORT_H / 2)},
speed = 200, speed = INITIAL_SPEED,
max_speed = 550, max_speed = MAX_SPEED,
vel = rl.Vector2{0,0}, vel = rl.Vector2{0,0},
shape = .Circle, shape = .Circle,
size = rl.Vector2{8, 0}, size = rl.Vector2{8, 0},
@@ -35,7 +37,7 @@ serve_ball :: proc(ball: ^Entity, serve_dir: u8) {
reset_ball :: proc(ball: ^Entity) { reset_ball :: proc(ball: ^Entity) {
ball.pos = rl.Vector2{(VIEWPORT_W / 2), (VIEWPORT_H / 2)} ball.pos = rl.Vector2{(VIEWPORT_W / 2), (VIEWPORT_H / 2)}
ball.vel = rl.Vector2{0,0} ball.vel = rl.Vector2{0,0}
ball.speed = 300 ball.speed = INITIAL_SPEED
ball.trail_positions = {} ball.trail_positions = {}
ball.trail_count = 0 ball.trail_count = 0
} }