diff options
| author | Marc Sunet <jeannekamikaze@gmail.com> | 2012-09-02 11:29:20 +0200 | 
|---|---|---|
| committer | Marc Sunet <jeannekamikaze@gmail.com> | 2012-09-02 11:29:20 +0200 | 
| commit | ae9425681f4a921f76a0aa763ba2d38dead31262 (patch) | |
| tree | 48e96e6f16fa7573fc6d5dc260f6a5b8278f68e1 | |
| parent | f4443882ac3dad333a4a80468f61f156f5adb6d5 (diff) | |
GameObject uses first collisioner to detect collisions
| -rw-r--r-- | Spear.lkshw | 2 | ||||
| -rw-r--r-- | Spear/Scene/GameObject.hs | 6 | 
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 @@ | |||
| 1 | Version of workspace file format: | 1 | Version of workspace file format: | 
| 2 | 1 | 2 | 1 | 
| 3 | Time of storage: | 3 | Time of storage: | 
| 4 | "Sun Sep 2 11:14:26 CEST 2012" | 4 | "Sun Sep 2 11:28:18 CEST 2012" | 
| 5 | Name of the workspace: | 5 | Name of the workspace: | 
| 6 | "Spear" | 6 | "Spear" | 
| 7 | File paths of contained packages: | 7 | File 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 | |||
| 268 | goCollide go1 go2 = | 268 | goCollide 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 | 
