improve Unit and utilities
This commit is contained in:
parent
60d71ae1c0
commit
1a24af7230
3 changed files with 36 additions and 35 deletions
35
main.odin
35
main.odin
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue