Problems Building a Sorting Mechanic
Here's what I'm trying to achieve:
I have 7 unique actors which I'm calling my Zones. These Zones are spread out in a horizontal line. On the top of each Zone is an additional unique actor which I'm calling a Character. So, I have a total of 14 actors, 7 are my Zones and the other 7 are my Characters, each Character resides on top of a Zone... Following so far?
The 7 Zones are in fixed positions in the scene. The 7 Characters spawn randomly, each one on top of one of the Zones. The objective is for the user to drag each character to their correct Zone. So for example we'll say Character 1 coordinates to Zone 1, Character 2 to Zone 2 and so on. I've set the random spawning of the characters in such a way, that at the start of the scene no Character spawns on their correct Zone.
So here's what I want... Let's say Character 1 is residing atop Zone 2 and Character 2 atop Zone 1. I want to drag Character 1 and have the actor snap into position over Zone 1 (I've achieved this part). Then I want Character 2 who was on Zone 1 to move to the vacant Zone 2. This is where I'm running into trouble. No matter what I try I end up with Characters flickering between positions or sharing Zones.
I don't need the whole algorithm spelled out but if someone can possible provide some insight on what attributes they'd use or how they might approach the problem, I'd be very grateful.
Currently I'm creating attributes on the Actor and Game level.
Thanks
I have 7 unique actors which I'm calling my Zones. These Zones are spread out in a horizontal line. On the top of each Zone is an additional unique actor which I'm calling a Character. So, I have a total of 14 actors, 7 are my Zones and the other 7 are my Characters, each Character resides on top of a Zone... Following so far?
The 7 Zones are in fixed positions in the scene. The 7 Characters spawn randomly, each one on top of one of the Zones. The objective is for the user to drag each character to their correct Zone. So for example we'll say Character 1 coordinates to Zone 1, Character 2 to Zone 2 and so on. I've set the random spawning of the characters in such a way, that at the start of the scene no Character spawns on their correct Zone.
So here's what I want... Let's say Character 1 is residing atop Zone 2 and Character 2 atop Zone 1. I want to drag Character 1 and have the actor snap into position over Zone 1 (I've achieved this part). Then I want Character 2 who was on Zone 1 to move to the vacant Zone 2. This is where I'm running into trouble. No matter what I try I end up with Characters flickering between positions or sharing Zones.
I don't need the whole algorithm spelled out but if someone can possible provide some insight on what attributes they'd use or how they might approach the problem, I'd be very grateful.
Currently I'm creating attributes on the Actor and Game level.
Thanks
Comments
http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./GSTemplateSHF.html
and 're-do' my game to suit this sorting mech. Looks like if could fit your needs quite well.