add player

This commit is contained in:
Morrígan 2025-06-22 21:47:58 +02:00
parent aab03eafef
commit 8babb48fd2
Signed by: morrigan
GPG key ID: CACB010F463A77D0
3 changed files with 21 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import "vendor:sdl3"
Faction :: enum {
Player,
Allied,
Enemy,
}
@ -19,9 +20,18 @@ RenderUnit :: proc(unit: Unit, game: Game) {
sdl3.SetRenderDrawColor(game.render, 0, 255, 0, 0)
case Faction.Enemy:
sdl3.SetRenderDrawColor(game.render, 255, 0, 0, 0)
case Faction.Allied:
sdl3.SetRenderDrawColor(game.render, 0, 0, 255, 0)
}
sdl3.RenderRect(
game.render,
&sdl3.FRect{x = unit.position.x, y = unit.position.y, w = 10, h = 10},
)
}
Projectile :: struct {
faction: Faction,
position: Position,
direction: Direction,
}