New fields for fat struct.

This commit is contained in:
2026-09-28 08:02:27 +02:00
parent c50f9cb2b7
commit 5ec8c918b3
+15 -5
View File
@@ -6,6 +6,7 @@ import rl "vendor:raylib"
// Generic base structure shared by all world objects. // Generic base structure shared by all world objects.
// Fields are populated selectively based on entity type. // Fields are populated selectively based on entity type.
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
MAX_TRAILS :: 8
Entity_Type :: enum { Entity_Type :: enum {
Player, Player,
@@ -23,17 +24,26 @@ Entity :: struct {
active: bool, active: bool,
pos: rl.Vector2, pos: rl.Vector2,
shape: Shape_Type, shape: Shape_Type,
color: rl.Color,
// width / height or diameter / diameter // width / height or diameter / diameter
size: rl.Vector2, size: rl.Vector2,
// Fixed input speed (paddles) // Fixed input speed (paddles)
speed: f32, speed: f32,
max_speed: f32, max_speed: f32,
// 2D momentum & direction (ball / physics) // 2D momentum & direction (ball / physics)
vel: rl.Vector2, vel: rl.Vector2,
target_y: f32, target_y: f32,
reaction_timer: f32 reaction_timer: f32,
}
// ------------------------------------------------------------------------------ // animation options
// @todo: entity dispatchers tween_duration: f32,
// ------------------------------------------------------------------------------ tween_elapsed: f32,
// trail effect
trail_positions: [MAX_TRAILS]rl.Vector2,
trail_count: int,
trail_timer: f32,
}