Moved and renamed entities.
This commit is contained in:
@@ -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
|
||||
// ------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user