B:BD[
4.748] → [
4.748:996]
handle_input :: proc(player: ^Player) {
if rl.IsKeyDown(rl.KeyboardKey.A) do player.x -= 2
if rl.IsKeyDown(rl.KeyboardKey.D) do player.x += 2
if rl.IsKeyDown(rl.KeyboardKey.W) do player.y -= 2
if rl.IsKeyDown(rl.KeyboardKey.S) do player.y += 2
handle_input :: proc(world: ^ecs.World) {
ecs.Work(world, proc(e: ecs.Entity, p: ^Position, d: ^Player) {
if rl.IsKeyDown(rl.KeyboardKey.A) do p.x -= 2
if rl.IsKeyDown(rl.KeyboardKey.D) do p.x += 2
if rl.IsKeyDown(rl.KeyboardKey.W) do p.y -= 2
if rl.IsKeyDown(rl.KeyboardKey.S) do p.y += 2
})
}
Player :: struct {}
Position :: struct {
x: f32,
y: f32,