(once) and (oncePerInstance)

This commit is contained in:
2021-04-27 20:05:57 -06:00
parent fa72a9776d
commit 42d50600d1
5 changed files with 45 additions and 10 deletions

View File

@@ -1,11 +1,8 @@
(defprop &mut firstDraw true)
(defmethod new [] 0)
(defmethod :Void initialize [:Assets assets]
(assets.loadSurface "laptop" AssetPaths.laptop__srf))
(defmethod :Void update [:Game game :Float deltaSeconds] 0)
(defmethod :Void draw [:Void->Graphics graphics :Assets assets]
(when firstDraw
(set firstDraw false)
(oncePerInstance
(.blitSurface (graphics) (assets.getSurface "laptop") 0 0)))