I made a couple of games already. But this one is the first to make me in real troubles. I am not even sure how the final rules of the gameplay will be, but I can't mane anything work. Here is what I want to do :
It's kind of connect four (http://en.wikipedia.org/wiki/Connect_Four), but when you connect four, the associated pieces are deleted and you keep on it until your table is full. And obviously there would be more than 2 colors. I am working with 5 colors right now. So I made a sprite with 5 frames to differenciate the colors.
My basic proble is that I can't use that kind of code (for example) :
If frame of objectx = frame of objectx,
and objectx.X = objectx.X+40,
and objectx.Y = objectx.Y
Then delete objectx
It's more complicated than this but what I mean is that, I can't tell the game when pieces of the same color are align. Cause the he can't differenciate the different instances of the same object.
I have tried to work with arrays, but I'm not sure exactly how to do.
I'm not asking for a complete example, I'm just asking for an hint.
Also, for making things easier, I have make another object invisible following every tick the different pieces. I made it larger than the visible object so it get in collision with pieces on the side. But as a result, if there are 100 pieces on the screen, there are 100 other pieces to overlap them everythick. It makes it laggy on mobile phones. But I'm sure there is a better solution than working with invisible trigger object.