aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Sunet <jeannekamikaze@gmail.com>2012-08-30 22:45:46 +0200
committerMarc Sunet <jeannekamikaze@gmail.com>2012-08-30 22:45:46 +0200
commitf3ed8e46d5913806cd8873df678bcd3362e98c93 (patch)
tree1aadc6431183e00a7986eccabb73681fa0015da5
parent25e0a6b7b06086ba156dfdd6b12da4fa6d34ee15 (diff)
Added setCollisioners
-rw-r--r--Spear.lkshw2
-rw-r--r--Spear/Scene/GameObject.hs6
2 files changed, 7 insertions, 1 deletions
diff --git a/Spear.lkshw b/Spear.lkshw
index fb35953..840d91d 100644
--- a/Spear.lkshw
+++ b/Spear.lkshw
@@ -1,7 +1,7 @@
1Version of workspace file format: 1Version of workspace file format:
2 1 2 1
3Time of storage: 3Time of storage:
4 "Thu Aug 30 22:30:11 CEST 2012" 4 "Thu Aug 30 22:44:59 CEST 2012"
5Name of the workspace: 5Name of the workspace:
6 "Spear" 6 "Spear"
7File paths of contained packages: 7File paths of contained packages:
diff --git a/Spear/Scene/GameObject.hs b/Spear/Scene/GameObject.hs
index 62bb27e..e012122 100644
--- a/Spear/Scene/GameObject.hs
+++ b/Spear/Scene/GameObject.hs
@@ -16,6 +16,7 @@ module Spear.Scene.GameObject
16, setAnimation 16, setAnimation
17, setAnimationSpeed 17, setAnimationSpeed
18, withCollisioners 18, withCollisioners
19, setCollisioners
19 -- * Rendering 20 -- * Rendering
20, goRender 21, goRender
21 -- * Collision 22 -- * Collision
@@ -170,6 +171,11 @@ withCollisioners :: GameObject -> ([Collisioner] -> [Collisioner]) -> GameObject
170withCollisioners go f = go { collisioners = f $ collisioners go } 171withCollisioners go f = go { collisioners = f $ collisioners go }
171 172
172 173
174-- | Set the game object's collisioners.
175setCollisioners :: GameObject -> [Collisioner] -> GameObject
176setCollisioners go cols = go { collisioners = cols }
177
178
173-- | Get the game object's ith bounding box. 179-- | Get the game object's ith bounding box.
174goAABB :: Int -> GameObject -> AABB 180goAABB :: Int -> GameObject -> AABB
175goAABB i go = goAABB' $ (collisioners go) !! i 181goAABB i go = goAABB' $ (collisioners go) !! i