Deltatime movement

This commit is contained in:
Joseph Ferano 2024-11-18 21:58:35 +07:00
parent fcb067f5bd
commit ebf769eeb7

View File

@ -87,7 +87,7 @@
(setf kpos click-pos)
;; (setf (velocity knight1) (vec 0 0))
(setf click-pos nil))
(let ((vel (v* 3.0 (vunit* dist))))
(let ((vel (v* (* (rl:get-frame-time) 150.0) (vunit* dist))))
(setf (velocity knight1) vel)
(setf kpos (v+ kpos vel)))))))))
@ -134,7 +134,7 @@
(let* ((screen-width 900)
(screen-height 500))
(rl:with-window (screen-width screen-height "RTS")
(rl:set-target-fps 60)
(rl:set-target-fps 120)
(game-init)
(loop :until (rl:window-should-close)
:do (game-input)