vine swing

F

fireair

Guest
So I am making pitfall and need to be able to have a player object swing on the vine that hangs from the ceiling of the room the vine starts in image angle at 315 and swings to 225 then reverses my teacher mentioned transformation/rotation matrices but I'm not sure how to enter/use them.
 

samspade

Member
So I am making pitfall and need to be able to have a player object swing on the vine that hangs from the ceiling of the room the vine starts in image angle at 315 and swings to 225 then reverses my teacher mentioned transformation/rotation matrices but I'm not sure how to enter/use them.
While probably not exactly what you need, here is the basic idea:

https://forum.yoyogames.com/index.php?threads/rope-swing-physics.34562/#post-220740

There's also a free asset on the marketplace that may or may not work for you: https://marketplace.yoyogames.com/assets/761/ropewater-physics-platformer.
 
N

NeonBits

Guest
you could make a vertical sprite, place it's origine at its top, then use image_angle to swing it; add one boolean variable:
Code:
if ((variable == false) && (image_angle >= 225))
{image_angle -= 0.3;}
else
if ((variable == false) && (image_angle < 225))
{variable = true;}

if ((variable == true) && (image_angle <= 315))
{image_angle += 0.3}
else
if ((variable == true) && (image_angle > 315))
{variable = false;}
 
Top