add player
This commit is contained in:
parent
aab03eafef
commit
8babb48fd2
3 changed files with 21 additions and 2 deletions
10
unit.odin
10
unit.odin
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue