gameplay prototype

This commit is contained in:
wooshings
2026-09-26 20:48:09 -07:00
parent 480501a6b6
commit f453d0b1bf
4 changed files with 107 additions and 13 deletions
+14 -8
View File
@@ -1,5 +1,6 @@
package main
import "core:fmt"
import rl "vendor:raylib"
move :: proc(t: ^Transform, x, y: f32) {
@@ -13,16 +14,21 @@ move :: proc(t: ^Transform, x, y: f32) {
}
}
shoot :: proc(pos: rl.Vector2, t: Transform) {
shoot :: proc(t: Transform, pos: rl.Vector2) {
pos_centered := center_to_grid(pos)
t_centered := center_to_grid(t.position)
rl.DrawLine(
i32(t.position.x) * CELL_SIZE + (CELL_SIZE / 2),
i32(t.position.y) * CELL_SIZE + (CELL_SIZE / 2),
i32(pos_centered.x),
i32(pos_centered.y),
rl.WHITE,
)
line_particle := LineParticle {
pos1 = t.position * CELL_SIZE + 10,
pos2 = pos + 10,
tint = rl.WHITE,
lifetime = 0.2,
}
spawn_particle(line_particle)
start_timer(1, test_timer_callback)
}
test_timer_callback :: proc() {
fmt.println("timer finished")
}
center_to_grid :: proc(pos: rl.Vector2) -> rl.Vector2 {