From ae9425681f4a921f76a0aa763ba2d38dead31262 Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Sun, 2 Sep 2012 11:29:20 +0200 Subject: GameObject uses first collisioner to detect collisions --- Spear.lkshw | 2 +- 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 @@ Version of workspace file format: 1 Time of storage: - "Sun Sep 2 11:14:26 CEST 2012" + "Sun Sep 2 11:28:18 CEST 2012" Name of the workspace: "Spear" 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 goCollide go1 go2 = let cols1 = collisioners go1 cols2 = collisioners go2 - c1 = cols1 !! 1 - c2 = cols2 !! 1 + c1 = cols1 !! 0 + c2 = cols2 !! 0 in - if length cols1 < 2 || length cols2 < 2 then False + if length cols1 == 0 || length cols2 == 0 then False else c1 `collide` c2 /= NoCollision -- cgit v1.2.3