diff options
-rw-r--r-- | Spear/Scene/GameObject.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Spear/Scene/GameObject.hs b/Spear/Scene/GameObject.hs index 2efadf0..37374cc 100644 --- a/Spear/Scene/GameObject.hs +++ b/Spear/Scene/GameObject.hs | |||
@@ -2,10 +2,12 @@ module Spear.Scene.GameObject | |||
2 | ( | 2 | ( |
3 | GameObject | 3 | GameObject |
4 | , GameStyle(..) | 4 | , GameStyle(..) |
5 | , AnimationSpeed | ||
5 | -- * Construction | 6 | -- * Construction |
6 | , goNew | 7 | , goNew |
7 | -- * Manipulation | 8 | -- * Manipulation |
8 | , goUpdate | 9 | , goUpdate |
10 | , Spear.Scene.GameObject.setAnimationSpeed | ||
9 | , goAABB | 11 | , goAABB |
10 | -- * Rendering | 12 | -- * Rendering |
11 | , goRender | 13 | , goRender |
@@ -190,6 +192,13 @@ goCollide gos go = foldl' collide' [] gos | |||
190 | collide' gos target = target:gos | 192 | collide' gos target = target:gos |
191 | 193 | ||
192 | 194 | ||
195 | -- | Set the game object's animation speed. | ||
196 | setAnimationSpeed :: AnimationSpeed -> GameObject -> GameObject | ||
197 | setAnimationSpeed s go = case renderer go of | ||
198 | Left _ -> go | ||
199 | Right amr -> go { renderer = Right $ AM.setAnimationSpeed s amr } | ||
200 | |||
201 | |||
193 | -- | Get the game object's bounding box. | 202 | -- | Get the game object's bounding box. |
194 | goAABB :: GameObject -> AABB | 203 | goAABB :: GameObject -> AABB |
195 | goAABB go = | 204 | goAABB go = |