make Pituicat an Actor and update it properly
This commit is contained in:
parent
3bfa8671b0
commit
4137101dbc
|
@ -139,6 +139,11 @@ instance Scene Test where
|
||||||
update level dt = liftIO $ do
|
update level dt = liftIO $ do
|
||||||
logIO Debug ("FPS: " <> fromString (show $ 1 / dt))
|
logIO Debug ("FPS: " <> fromString (show $ 1 / dt))
|
||||||
|
|
||||||
|
-- Let all Actors update themselves (Typeclasses rock!)
|
||||||
|
atomically $
|
||||||
|
modifyTVar
|
||||||
|
(testCast level)
|
||||||
|
(V.map (\(Cast c) -> Cast (perform dt c)))
|
||||||
|
|
||||||
onEvents _ _ = return ()
|
onEvents _ _ = return ()
|
||||||
|
|
||||||
|
@ -175,7 +180,8 @@ instance Scene Test where
|
||||||
logIO Debug "Wrote buffers"
|
logIO Debug "Wrote buffers"
|
||||||
|
|
||||||
bind (tileMapTexture tileMap)
|
bind (tileMapTexture tileMap)
|
||||||
mapM_ (\(StageSet p) -> bindPropTexture p) stageSet
|
V.mapM_ (\(StageSet p) -> bindPropTexture p) stageSet
|
||||||
|
V.mapM_ (\(Cast c) -> bindPropTexture c) cast
|
||||||
R.draw va ib sh
|
R.draw va ib sh
|
||||||
|
|
||||||
logIO Debug "Drawn"
|
logIO Debug "Drawn"
|
||||||
|
|
|
@ -11,6 +11,7 @@ import qualified Data.Vector as V
|
||||||
import Classes.Graphics.Drawable
|
import Classes.Graphics.Drawable
|
||||||
import Classes.Graphics.Bindable
|
import Classes.Graphics.Bindable
|
||||||
import Classes.Prop
|
import Classes.Prop
|
||||||
|
import Classes.Actor
|
||||||
|
|
||||||
import Types.Graphics.VertexBuffer
|
import Types.Graphics.VertexBuffer
|
||||||
import Types.Texture
|
import Types.Texture
|
||||||
|
@ -56,3 +57,7 @@ instance Prop Pituicat where
|
||||||
residentLayer _ = 0
|
residentLayer _ = 0
|
||||||
|
|
||||||
bindPropTexture = bind . pcTexture
|
bindPropTexture = bind . pcTexture
|
||||||
|
|
||||||
|
instance Actor Pituicat where
|
||||||
|
|
||||||
|
perform _ p = p
|
||||||
|
|
Loading…
Reference in a new issue