• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker How to make an object move in a figure 8 motion

G

gamer_essence

Guest
I want to have a atom looking thing move in a figure eight as a loading symbol.
 

Pfap

Member
You could try making a figure 8 path and having an instance follow it, while your waiting for whatever you're loading.
 
Have a variable counting up, wrap it with the sine function for each axis, but multiply the variable by 2 on the y axis. Multiply the sien function itself to extend the distance the instance will move on each axis.
 

FrostyCat

Redemption Seeker
See: Lissajous curve

Create:
Code:
t = 0;
dt = pi/(3*room_speed);
xrad = 120;
yrad = 120;
Step:
Code:
x = xstart+xrad*sin(t+pi/2);
y = ystart+yrad*sin(2*t);
t += dt;
if (t >= 2*pi) {
  t -= 2*pi;
}
 
Top