0 Favourites

Moving the object at an angle

  • Hey guys !

    How do i make an object move or glide towards the cursor ? And how do i add forces which changes the angle when it is moving towards the cursor ?

    Thanks in advance ! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • here you go.

    Is that what you're after? Keep in mind I didn't implement acceleration but that's pretty simple.

  • squiddster Thanks a lot for building this but when i try to open it, it shows this

    <img src="https://dl.dropbox.com/u/79020893/New%20project1/error.PNG" border="0" />

    The r90 isn't the latest version ?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Make a instance variable (text) name it state for your obj

    the event:

    System - Compare two values


    Distance(mouse.X, mouse.Y, obj.X, obj.Y)

    greater than


    The Action for obj is:

    Set value


    instance variable State


    You can make as many states as you like. Now make events for your states like this:

    obj - compare instance variable


    instanse variable = State

    Comparison = Equal to

    Value = "Close"

    Add a sub event

    Every tick

    Action: obj -> rotate toward position parameters:

    Degrees = 5

    x = mouse.X

    y = mouse.y

    Action: obj -> move forvard 3 px

  • squiddster Thanks a lot for building this but when i try to open it, it shows this


    The r90 isn't the latest version ?

    r90 is the latest stable version, r91 is a testing version.

    You can download it here.

  • Monumental Awesome ! :D thanks a lot !

    @KFC Thank you <img src="smileys/smiley1.gif" border="0" align="middle" />

    @ sqiddster what i wanted is something similar to paper toss ..that is, once when clicked the object should acquire the point of the cursor and move towards it <img src="smileys/smiley1.gif" border="0" align="middle" /> . I think i can make modifications for that !

    Thanks again.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
564 105,179
rexrainbow's avatar
Unread hot topic
167 14,485
DMT2005's avatar
Unread hot topic
0 Favourites
Time to move forward?
110 9,560
GG-Works's avatar