collision end?
jmp909
Member Posts: 73
is it possible to determine when a collision ends? eg
if actor collides with actor of type alien, add 1 to actor "touchcount" attribute
else subtract 1 from actor "touchcount" attribute
so say if my actor collides with 2 aliens at the same time, the score will be 2 but when one of the aliens bounces off , the score will be 1 (only 1 alien still touching)
thanks
j
there's probably another way round this, but i can't work out how
if actor collides with actor of type alien, add 1 to actor "touchcount" attribute
else subtract 1 from actor "touchcount" attribute
so say if my actor collides with 2 aliens at the same time, the score will be 2 but when one of the aliens bounces off , the score will be 1 (only 1 alien still touching)
thanks
j
there's probably another way round this, but i can't work out how
Comments
http://gamesalad.com/forums/topic.php?id=2019#post-10939
thanks
j
eg if actor collides with actor of type alien and CollidedActor.touchCount>=2.... then destroy this actor (for match3, i believe an item just needs to touch another actor that is touching 2 others...(or rather 1 other, other than itself and the collided actor)
if ABC are touching and D is added to make ABCD then C's touchcount is only actually 1 at this point (touches .. it only becomes 2 when D is added, so D would have to be able to reference C as suggested above to add to D's touchcount first... this might also be affected by the order in which the rules run i guess
looking at the forums presumably other people have tried this and it's not possible with the current version of GS?
thanks
j
In GS, you COULD use collisions, but then you'd have let's say 100 (10x10 grid) actors all testing for collisions.
100 actors doing collision checks all the time would kill performance.
CodeMonkey has a test of SameGame working under his profile. But that would really difficult to try to make work for a iPhone 3G.
Until GS gets something like a 2D array, grid-based puzzle games are going to be really difficult to make.