Moved and renamed entities.

This commit is contained in:
2026-09-09 07:17:28 +02:00
parent 6b6725b8bb
commit c6ab8705d1
4 changed files with 119 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package game
import rl "vendor:raylib"
// ------------------------------------------------------------------------------
// Generic base structure shared by all world objects.
// Fields are populated selectively based on entity type.
// ------------------------------------------------------------------------------
Entity_Type :: enum {
Player,
Enemy,
Ball,
}
Shape_Type :: enum {
Rectangle,
Circle,
}
Entity :: struct {
type: Entity_Type,
active: bool,
pos: rl.Vector2,
shape: Shape_Type,
// width / height or diameter / diameter
size: rl.Vector2,
// Fixed input speed (paddles)
speed: f32,
// 2D momentum & direction (ball / physics)
vel: rl.Vector2,
}
// ------------------------------------------------------------------------------
// TODO: Entity Dispatchers
// ------------------------------------------------------------------------------