switch repo to just cleaning game focus
This commit is contained in:
parent
276c7c562b
commit
6d5406c6c5
49 changed files with 0 additions and 150 deletions
|
|
@ -1,37 +0,0 @@
|
|||
(local beholder (require "libs/beholder"))
|
||||
(local color (require "src/colors.fnl"))
|
||||
|
||||
;; Camera System
|
||||
|
||||
(local camera {:x 0 :y 0})
|
||||
|
||||
(fn camera.draw2 [self]
|
||||
(love.graphics.push)
|
||||
(love.graphics.translate (* -1 self.x) (* -1 self.y)))
|
||||
|
||||
(fn camera.load [self]
|
||||
(let [screen self.pool.data.screen]
|
||||
(beholder.observe "PLAYER.POS" (lambda [x y]
|
||||
;; Update camera to follow player (keep player centered on screen)
|
||||
(set self.x (- x (/ screen.canvas-w 2)))
|
||||
(set self.y (- y (/ screen.canvas-h 2)))))))
|
||||
|
||||
(fn camera.draw89 [self]
|
||||
(love.graphics.pop)) ; undo camera translation
|
||||
|
||||
(fn camera.draw99 [self]
|
||||
(let [screen self.pool.data.screen canvas self.pool.data.canvas]
|
||||
(love.graphics.setCanvas) ; reset to root canvas
|
||||
(color:reset-color)
|
||||
(love.graphics.draw canvas 0 0 0 screen.scale screen.scale)))
|
||||
|
||||
(fn camera.draw1 [self]
|
||||
(let [screen self.pool.data.screen canvas self.pool.data.canvas]
|
||||
; use canvas
|
||||
(love.graphics.setCanvas canvas)
|
||||
; clear the screen
|
||||
(love.graphics.clear)
|
||||
(color.set-color :cream)
|
||||
(love.graphics.rectangle "fill" 0 0 screen.canvas-w screen.canvas-h)))
|
||||
|
||||
camera
|
||||
Loading…
Add table
Add a link
Reference in a new issue