aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Sunet <jeannekamikaze@gmail.com>2012-09-02 11:29:20 +0200
committerMarc Sunet <jeannekamikaze@gmail.com>2012-09-02 11:29:20 +0200
commitae9425681f4a921f76a0aa763ba2d38dead31262 (patch)
tree48e96e6f16fa7573fc6d5dc260f6a5b8278f68e1
parentf4443882ac3dad333a4a80468f61f156f5adb6d5 (diff)
GameObject uses first collisioner to detect collisions
-rw-r--r--Spear.lkshw2
-rw-r--r--Spear/Scene/GameObject.hs6
2 files changed, 4 insertions, 4 deletions
diff --git a/Spear.lkshw b/Spear.lkshw
index 8c102af..c0d466b 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 "Sun Sep 2 11:14:26 CEST 2012" 4 "Sun Sep 2 11:28:18 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 1195f61..b892b7d 100644
--- a/Spear/Scene/GameObject.hs
+++ b/Spear/Scene/GameObject.hs
@@ -268,8 +268,8 @@ goCollide :: GameObject -> GameObject -> Bool
268goCollide go1 go2 = 268goCollide go1 go2 =
269 let cols1 = collisioners go1 269 let cols1 = collisioners go1
270 cols2 = collisioners go2 270 cols2 = collisioners go2
271 c1 = cols1 !! 1 271 c1 = cols1 !! 0
272 c2 = cols2 !! 1 272 c2 = cols2 !! 0
273 in 273 in
274 if length cols1 < 2 || length cols2 < 2 then False 274 if length cols1 == 0 || length cols2 == 0 then False
275 else c1 `collide` c2 /= NoCollision 275 else c1 `collide` c2 /= NoCollision