Collisions counting problem

glyniusglynius Member Posts: 231
edited July 2012 in Working with GS (Mac)
Hi again, i have a problem and i would appreciate any help.
So...i have some tiles arranged in collumns and rows, imagine like arkanoid. I set a rule to this actor (tile), so when it collides with the ball, it destroys the actor one by one, and adds 1 to an attribute. The tiles are actually 1 actor copied multiple times in the scene.
It works great, except that when the ball collides, at the same time with 2 actors, it counts it only one... so at the end... sometimes, when all the tiles are dead, i don't get the correct number from the counting attribute. Any ideas?

Comments

  • glyniusglynius Member Posts: 231
    I think there must be something else going on here.
    Because from what i understand Nothing happens at the same time.
    Every rule is fired off 1 by 1 till there all done.

    even if you take 6 actors put them on the scene and tell them all to change attribute to +1 at the same time it WILL change to 6

    there must be some other issue.

    cheers

    Thanks for answering. I really don't know what else could be wrong there. I've checked multiple times using and actor and displaying the attribute, when the ball collides with two tiles at a time, it misses one to the counting. Could this be a bug or something?
  • glyniusglynius Member Posts: 231
    Still no luck with the collision problem...anybody please?
  • beepbeep Member Posts: 30
    Hi,
    I've got the same problem ;)
  • beepbeep Member Posts: 30
    anyone ?
  • simo103simo103 Member, PRO Posts: 1,331
    edited July 2012
    @beep .. just a guess to try and help ... maybe your destroy attribute is triggering before the count has time to complete .. try wrapping it in a timer to test that idea so say after 0.3 secs destroy and make sure your counter attribute is above that destroy. If it works then move the timer down to 0.1 secs and test and see if it is acceptable. If it works but you need to keep the timer at 0.3 for example then put a change self.color.alpha to 0 in the actor so it disappears from sight and then destroys.
  • glyniusglynius Member Posts: 231
    @beep .. just a guess to try and help ... maybe your destroy attribute is triggering before the count has time to complete .. try wrapping it in a timer to test that idea so say after 0.3 secs destroy and make sure your counter attribute is above that destroy. If it works then move the timer down to 0.1 secs and test and see if it is acceptable. If it works but you need to keep the timer at 0.3 for example then put a change self.color.alpha to 0 in the actor so it disappears from sight and then destroys.
    i'll give it a try also. Thanks
  • beepbeep Member Posts: 30
    I don't want to destroy any actor.
    Imagine a game with tiles. When a tile collides with another one, it adds 1 points. But when an other tile comes in play and collides with to other tiles, it count only 1 point in place of 2.
  • glyniusglynius Member Posts: 231
    even me, that i want to destroy the actor, i have the same problem even when i use a timer for destroying the actor...that's bad...
Sign In or Register to comment.