evildead9000
Member
I'm currently learning to use Sin from an old post from Gre_Lor12: https://forum.yoyogames.com/index.php?threads/vertical-sine-wave.8185/.
This is the code:
I applied it to an enemy script, which is placed in its step event. I've attempted to combine it with:
However, it correctly moves in the sin motion, but does not approach the player.
Any help would be greatly appreciated.
Thanks!
This is the code:
GML:
var Amp = 20; //How "Stretched" the wave is
var Freq = 10 //How much to increase the waves amplitude by (in px)
x = xstart + Amp*sin(y/Freq);
GML:
move_towards_point(obj_Player.x, obj_Player.y, enemy_speed);
Any help would be greatly appreciated.
Thanks!