improve Unit and utilities

This commit is contained in:
Morrígan 2025-06-28 15:21:52 +02:00
parent 60d71ae1c0
commit 1a24af7230
Signed by: morrigan
GPG key ID: CACB010F463A77D0
3 changed files with 36 additions and 35 deletions

View file

@ -30,40 +30,19 @@ main :: proc() {
assert(render != nil)
units := make([dynamic]Unit)
append(
&units,
Unit {
faction = Faction.Allied,
position = util.Position{x = 500, y = 500},
velocity = DEFAULT_VELOCITY,
hp = 100,
},
)
append(
&units,
Unit {
faction = Faction.Enemy,
position = util.Position{x = 700, y = 700},
velocity = DEFAULT_VELOCITY,
hp = 100,
},
)
append(&units, NewUnit(Faction.Allied, util.Position{500, 500}))
append(&units, NewUnit(Faction.Enemy, util.Position{700, 700}))
input_state := make(map[sdl3.Scancode]bool)
time := sdl3.GetTicksNS()
game := Game {
render = render,
units = units,
player = Unit {
faction = Faction.Player,
position = util.Position{x = 255, y = 255},
velocity = DEFAULT_VELOCITY,
hp = 100,
},
time = time,
delta = 0.0,
render = render,
units = units,
player = NewUnit(Faction.Player, util.Position{100, 100}, 200),
time = time,
delta = 0.0,
input_state = input_state,
}