So I'm trying to make a projectile move in a sideways figure eight motion without having to use paths (please don't ask why), but for some reasons, I never can seem to get the projectile movement right...
Create Event:
Code:
/* Movemement */
parent = 0;
sinewave = 0;
hortime = 5;
hordir = 1;
Step Event:
Code:
if (hordir = -1 && hortime > -10){
hortime += -0.5;
} else if (hordir = -1 && hortime <= -10){
hordir = 1;
} else if (hordir = 1 && hortime < 10){
hortime += 0.5;
} else if (hordir = 1 && hortime >= 10){
hordir = -1;
}
sinewave += 5;
y = ystart+lengthdir_y(40,sinewave);
hspeed = -image_xscale*(hortime/2);
Anyone knows what I'm doing wrong? I would be glad if someone could help me there. Thanks in advance!
So I'm trying to make a projectile move in a sideways figure eight motion without having to use paths (please don't ask why), but for some reasons, I never can seem to get the projectile movement right...
Create Event:
[code]/* Movemement */
parent = 0;
sinewave = 0;
hortime = 5;
hordir = 1;[/code]
Step Event:
[code]if (hordir = -1 && hortime > -10){
hortime += -0.5;
} else if (hordir = -1 && hortime <= -10){
hordir = 1;
} else if (hordir = 1 && hortime < 10){
hortime += 0.5;
} else if (hordir = 1 && hortime >= 10){
hordir = -1;
}
sinewave += 5;
y = ystart+lengthdir_y(40,sinewave);
hspeed = -image_xscale*(hortime/2);[/code]
Anyone knows what I'm doing wrong? I would be glad if someone could help me there. Thanks in advance!