Element awareness remind me of what I read in the Keith Peter's book
"Advanced AS3 Animation".
I would go to use a Vector2D class he has recreated from other
programming language (there's also a Vector3D class built-in in flash).
He's talking about the Craig Reynolds' demo (which are element moving in
the same direction like a bunch of birds):
http://www.red3d.com/cwr/boids/
The class make things easier to handle sterring behavior, such as seek,
flee, etc...
I would start with this way of animating things, add the size and the
mouse behavior in a custom class.
You can download the source there:
http://www.friendsofed.com/download.html?isbn=1430216085
and see the demo in the chapter 2.
Hope it helps.
Romu
www.soundstep.com
Muzak wrote:
and every element needs to know where the mouse cursor is and to know
in wich direction to move
No they don't, a parent class should take care of all of that.
The elements themselves should not be aware of any of this and should
be told (by the parent class) when and how to resize/animate/etc..
regards,
Muzak
----- Original Message ----- From: "Sander Schuurman"
<sander.schuur...@oswaldandruby.com>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, February 12, 2009 5:24 PM
Subject: RE: [Flashcoders] Advanced Rollover Physics/Math...
Do you know kinda where to start... I'm trying to figure out how I
would program the awareness of the elements.
There must be some kind of idle position, and every element needs to
know where the mouse cursor is and to know in wich direction to move,
and know how big it needs to be according to the mouseposition, and
how much space there is inside his 'zone', etc. etc.
pfoe
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders