Tween 2.3.0 with AGS 3.6.0 support!

Started by edmundito, Tue 04/04/2023 01:35:15

Previous topic - Next topic

Snarky

Yeah, I think CW is right that this would be the way to do it with the module. For example, to do a "throw a ball" (parabolic) arc you could tween the X-position with linear easing for 1 second, while tweening the Y-position up and then down (for 0.5 seconds each) using quadratic easing.

But personally, I think once you're having to combine tweens this way, syncing the timings and all that, it's easier to just do it yourself, so in most cases I would probably program the movement directly. You simply have to use the same equation you would use to draw a graph of the curve. (So, for a parabolic arc, y = ax^2 + bx + c.)

edmundito

#21
Quote from: FortressCaulfield on Sat 15/06/2024 18:23:41Someone recommended me this mod for moving chars or objects in a smooth arc and I don't understand how I would make it do that. Any help?

Can you explain the "arc" you are trying to create?

What you need to do is have two tweens. One that moves the X and the other the Y. Here's an example of how to do a circular arc:

Code: ags
player.TweenX(0.5, player.x + 100, eEaseLinearTween, eNoBlockTween);
player.TweenY(0.5, player.y + 100, eEaseOutQuadTween, eBlockTween);

The movement would be similar to this: https://easings.net/#easeOutQuad

If you want the object to go up and then down, then you write the code in two parts:
Code: ags
player.TweenX(0.5, player.x + 50, eEaseLinearTween, eNoBlockTween);
player.TweenY(0.5, player.y + 100, eEaseOutQuadTween, eBlockTween);
player.TweenX(0.5, player.x + 50, eEaseLinearTween, eNoBlockTween);
player.TweenY(0.5, player.y - 100, eEaseOutQuadTween, eBlockTween);

FortressCaulfield

Okay, so it can do what I need. That arc is perfect as it is for someone thrown off a moving vehicle. Thanks!
"I can hear you! My ears do more than excrete toxic mucus, you know!"

-Hall of Heroes Docent, Accrual Twist of Fate

Baguettator

Hi there, is this module going to be updated with AGS 4.0 compatibility ? And is there any release date ? Just to know, no pressure :)

Thanks for the work anyway !

SMF spam blocked by CleanTalk