Control Angle via Mouse

  • Hello again <img src="smileys/smiley1.gif" border="0" align="middle" />

    does anyone of you have an idea, how to control the angle of a player directly with the left / right movement of the mouse? (like in ego-shooters)

    I dont want the player just look towards the mouse position.

    Thanks and best regards <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Not sure what you mean, no idea what an ego-shooter is!

    Some sort of example image or something would be nice.

  • hey sqiddster <img src="smileys/smiley1.gif" border="0" align="middle" />

    sorry for my english.

    if the player moves the mouse left, he should turn left. same to the right. both directly. u did never play an ego shooter? the view is 2d from up.

    greets

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Does ego shooter mean a 1st person shooter?

    Anyway, this example the player angles toward and follows the mouse and goes faster the the farther from the mouse, etc.

    butterflyFollow.capx

  • Thanks, kittiewan.

    Yes, it is a 1st person shooter with view from top.

    Your solution does not help me solving this. I'll try to fit the left / right movement of the mouse directly to the angle. The problem is, how to capture the data of x-distance while moving the mouse.

  • Top Down shooter then :D

    A first person POV is through the eyes of the character isn't it?

    Do you have a game example of what you want to do?

  • Hey Yann,

    Yes, simple WSAD movement.

    I already did the first part...angle now "follows" the change of X of a pixel, which is moved by the mouse. Just didnt find another solution yet.

    <img src="http://dl.dropbox.com/u/54216429/wsadmovement.png" border="0" />

    But other problems keep occuring:

    • the aiming stops when the mouse reached the borders of the screen.
    • the aiming sometimes does not work anymore when moving the mouse outside the layout

    any ideas welcome <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)