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