[Behavior] moveto

  • wow dude I forgot I had this behaviour installed... it saved me all the code(events) I was making to do what I can do in two lines. Awesome mon.

  • Can we make this move to behavior to & fro like an sprite with this behavior goes to a certain point & returns constantly !!!

  • rexrainbow I noticed that the MoveTo's retrievable "Moving Angle" is not independent to the behavior. For example, if I use the MoveTo and Sine behaviors together, the movement from the Sine behavior changes the MoveTo's Moving Angle. I assume you're just getting the angle between the object's current position and previous position for this. Can it be fixed/changed? Or do you have a workaround?

  • Tokinsom

    Yes, the moving angle is calculated by "object's current position and previous position".

    You might store initial "moving angle" in private variable manually before moving.

  • rexrainbow It is possible to integrate some ease-in/out functions like this http://easings.net/ ?

    At the moment I use LiteTween behavior which is nice since is a combination of the sine + move_to begavior (it uses movement, size, values etc), but I like MoveTo behavior better.

    Ease InOut is great for moving menu items, dropping bouncing objects, it creates a more organic/elastic feeling

    The biggest problem with the LiteTween is that it rely on the time needed to move from A to B, instead of the speed and it does not have a control to "scale" the function, or define a start or end point (like acceleration and deceleration). The function is scaled depending on the time that takes

  • Cipriux

    Total time in easing function is fixed, and the speed will be changed by easing function.

    I do not think I could make a easing behavior which has a fixed maximum speed, it would not be an easing at all.

  • rexrainbow Tried that and a handful of other things. The sine keeps screwing it up. Can't you just change the moving angle to the angle between previous target and next target instead? Or a new type of moving angle that does something like that to be completely independent of other behaviors?

    edit: Trying to do this myself with events but it's easier said than done...

  • Tokinsom

    I would like to create a new expression instead of changing "MovingAngle" for backward compatible.

    Which name would you like?

    • MovingAnlge0
    • MovingAngleStart
    • ?
  • MovingAngleStart is fine. Thanks for taking the time to add this! I kind of found a different solution but it involves a dummy var and some other stuff and still isn't perfect.

  • Uptate

    MoveTo behavior: add expression:MovingAngleStart to get angle between start point to target position.

    Tokinsom

    Done.

  • hi rex,

    i would like to use your moveto plugin

    when i install it on c2

    and when i lunch c2 it gives me the following error

    http://www.hostingpics.net/viewer.php?i ... moveto.png]http://img11.hostingpics.net/pics/903678moveto.png

  • hi rex,

    i would like to use your moveto plugin

    when i install it on c2

    and when i lunch c2 it gives me the following error

    http://www.hostingpics.net/viewer.php?i ... moveto.png]http://img11.hostingpics.net/pics/903678moveto.png

    It should be put at behaviors folder, not plugins folder.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have it on the behaviours folder and still when I load a capx says that I am missing the behaviour as if it wasnt there.

  • Smileh

    I have no idea, sorry.

  • Hey! I really love the MoveTo behaviour. But I'm having a problem with it. Say I have an object with bullet behavior moving towards the right. And on click I use the MoveTo x=self.x y=self.y+100.

    It does everything right until it reaches the correct position. But once there the object jumps back to the x where it was before the I clicked.

    Is there a solution to this? I can not provide a capx because I'm at work. I might be able to do it tomorrow but I whould like to figure this out as soon as possible. Thanks

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