First of all, thanks everyone for help. My group somehow finished creating half-*****'d game past weekend for TOJAM event… boy that was hard.
We used copypixel, some spritemap to animate and 0 movie clips. Pure AS3, more or less.
We actually tried to solve this one problem for half a day and resorted to switching the player control to keyboard from mouse. (that was done in less than 1 hour… I wish we made the decision instead of wasting precious 7 hours of 48 hour competition… we could have done so much…sigh)
Anyway, I am working on it again and I am pretty happy with controls since I think I can easily port this for Wii later.
But the mouse control issue still annoys me. Here is the detail:
There are many little characters you can grab. When the user graps one of them and try to move them from one end of a room to the other, the character is pushed back if there is anyone on his/her path.
So we used hitTest to determine if there are anyone… then used rad/arctan formula to calculate the angle and pushed the character back.
We also found out if the user is still pressing down (dragging), then there would be increased offset (since the character is now bounced back even though user still controls him)… so I coded to lose the control of the character when that offset is beyond certain limit.
So far so good… but I noticed the characters shake a lot due to constantly being pushed back instead of being ‘stuck’ at certain distance and staying there.
I believe that’s because mouse is very sensitive and we are calculating by x,y coordinate, which changes ever so slightly.
Even the arctan funtion didn’t seem to work… as the character wasn’t bounced back at each angle but on 45 degrees or -135 degrees only…
Anyway, it seems other people had similar issues of mouse controlled charcter hitTest and collisionHandling same sized (small) objects.
If anyone has an advice or solution, please let me know. If I thoroughly confused everyone, I will see if I can create a simple code to showcase.