A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Constrained "Magnetic Indicator" to a half circle

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    17

    Constrained "Magnetic Indicator" to a half circle

    You can see a drawing of the balance indicator here: www.emerge.dk/stuff/indicator.gif

    I am in the process of making a game where i will need a balance indicator that can be controlled with the arrow keys. If you have played the Tony Hawk game it is pretty much self explanatory what it does. If not, try to imagine the arrow struggling to get as far away from the center point as possible, and the players task is to try to balance it on the middle using the arrow up and down keys.

    There is a series of issues in making the physics work.

    I need to constrain the indicator to a half circle?

    Do I have one repulsive pole in the middle that will catapult the arrow sideways? Or... Do I have two magnetic poles on each end of the half-circle pulling the arrow?

    I am not sure how to make either one. And I am not sure which the better alternative is.

    Thank you very much
    Peter

  2. #2
    ReMember gobbles's Avatar
    Join Date
    Nov 2002
    Location
    Denmark
    Posts
    983
    Hej Peter
    The easist thing to do in this case would be to make you're arrow go all the way to the middle of the "dial" and then move the centerpoint of the free ttransform tool to the middel of your dial/half circle and then make the bit of arrow you don't want visible ..._invisible.

    Now you can use setProperty and _rotation to move your arrow around.
    and you can tell flash how "hard " to push the arrow by how high the rotation is.

    I know tony Hawk and it's allmost impossible to keep it at 90'
    so you could say that pressing the arrows would change rotation 5' and as long as rotation was between 100-180 flash would push it by 1'
    but when I got between 100-90' flash would push 5' ,making it harder.

    Hmm Confusing answer I admid..sorry
    http://www.rickigregersen.com ...finally a blog!

    Your damned if you do...but your particually damned if you don´t

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center