A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: More Advanced Mouse Looking

  1. #1
    Knowledgable n00b BlueGeek's Avatar
    Join Date
    Nov 2006
    Location
    New York City
    Posts
    137

    More Advanced Mouse Looking

    Hello, Sandy again,

    I have a game which includes a directional light source. The source is controlled with the keyboard, the direction of the light is controlled with the mouse.

    demo (click on the frame to give it focus, use the arrow keys and mouse to control)

    This is all well and good but controlling the light is difficult and feels counter intuitive. Having it stick to a static point (the mouse location) while the source jumps around doesn't feel natural.

    What I would like to do is have the light look in the direction of the MOTION of the mouse.

    This is similar to how first person shooters are controlled, the mouse is constantly re-centered and the view changes based on the distance traveled on each frame.

    The issue is that I haven't found any way to re-center the mouse on each frame, and so there is no way to keep it on the sensing area of the stage.

    Does anyone know of a way to either control the mouse position, or get this effect through other means?
    Last edited by BlueGeek; 03-27-2011 at 05:22 PM. Reason: adding instructions for demo
    "...there were only two good books in the hotel gift shop and I had written both of them."
    -Douglas Adams

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