K
klanes
Guest
Hi guys! i have a new noob question...
I have a jail sprite hanging on a rope. I want to code a pendulum movement loop. I've tried a thousand ways using "image_angle", but I'm able to do it :\ (i want a coder brain in my head! XD)
It would also be great if the movement were smooth at the ends, like a real pendulum movement.
Here is the last version of my code (I know is a wrong code, only is the last attempt)
Create:
image_angle = 10;
rotacion = image_angle;
Step:
if rotacion <= 10;
{
image_angle -= 0.05;
}
if rotacion >= 350;
{
image_angle += 0.05;
}
----------
Many thanks for your help!!!
I have a jail sprite hanging on a rope. I want to code a pendulum movement loop. I've tried a thousand ways using "image_angle", but I'm able to do it :\ (i want a coder brain in my head! XD)
It would also be great if the movement were smooth at the ends, like a real pendulum movement.
Here is the last version of my code (I know is a wrong code, only is the last attempt)
Create:
image_angle = 10;
rotacion = image_angle;
Step:
if rotacion <= 10;
{
image_angle -= 0.05;
}
if rotacion >= 350;
{
image_angle += 0.05;
}
----------
Many thanks for your help!!!