get player debug rendering again
This commit is contained in:
parent
6bbdbd75df
commit
f69f08f656
2 changed files with 16 additions and 15 deletions
|
|
@ -303,7 +303,8 @@ while 1 do love.event.push('stdin', io.read('*line')) end") :start))
|
|||
(fn love.draw []
|
||||
(for [i 1 99 1]
|
||||
(let [draw-trigger (.. "draw" i)]
|
||||
(pool:emit draw-trigger))))
|
||||
(pool:emit draw-trigger)
|
||||
(when (and (= i 98) debug) (pool:emit "draw-debug")))))
|
||||
|
||||
; (fn love.draw []
|
||||
; (love.graphics.setCanvas screen.canvas)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
(local beholder (require "libs/beholder"))
|
||||
(local colors (require "src/colors.fnl"))
|
||||
(local color (require "src/colors.fnl"))
|
||||
(local levels (require "levels.fnl"))
|
||||
(local assets (require "src/assets.fnl"))
|
||||
|
||||
|
|
@ -66,22 +66,22 @@
|
|||
|
||||
(fn player.draw50 [self]
|
||||
"draw player sprite and hitbox"
|
||||
(colors:reset-color)
|
||||
(color:reset-color)
|
||||
(love.graphics.draw
|
||||
assets.player-sprite
|
||||
(. self.quads (angle-to-direction player.rot))
|
||||
self.x self.y)
|
||||
;; draw player hitbox and direction line
|
||||
; (when state.debug
|
||||
; (colors:set-color :black)
|
||||
; (love.graphics.rectangle "line" self.x self.y self.w self.h)
|
||||
; (love.graphics.push)
|
||||
; (let [ox (+ self.x (/ 25 2)) oy (+ self.y (/ 25 2))]
|
||||
; (love.graphics.translate ox oy)
|
||||
; (love.graphics.rotate self.rot)
|
||||
; (love.graphics.line 0 0 35 0))
|
||||
; (love.graphics.pop))
|
||||
)
|
||||
self.x self.y))
|
||||
|
||||
(fn player.draw-debug [self]
|
||||
"draw player hitbox and direction line"
|
||||
(color.set-color :black)
|
||||
(love.graphics.rectangle "line" self.x self.y self.w self.h)
|
||||
(love.graphics.push)
|
||||
(let [ox (+ self.x (/ 25 2)) oy (+ self.y (/ 25 2))]
|
||||
(love.graphics.translate ox oy)
|
||||
(love.graphics.rotate self.rot)
|
||||
(love.graphics.line 0 0 35 0))
|
||||
(love.graphics.pop))
|
||||
|
||||
|
||||
player
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue