Moving the object at an angle

0 favourites
  • 6 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • 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.

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

    <img src="" border="0" />

    The r90 isn't the latest version ?

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)