Moving the object at an angle

0 favourites
  • 6 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • 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="https://dl.dropbox.com/u/79020893/New%20project1/error.PNG" 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

    Parameters:

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

    greater than

    100

    The Action for obj is:

    Set value

    Parameters:

    instance variable State

    value="Close"

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

    obj - compare instance variable

    parameters:

    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

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

    https://dl.dropbox.com/u/79020893/New%20project1/error.PNG

    The r90 isn't the latest version ?

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

    You can download it here.

  • Try Construct 3

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

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