MindFAQ! Thank you for your help, and I have tried your formula, but something is not working and I am not sure where I went wrong.
Basically the enemies started oscillating in a uniform vertical direction really fast.
<img src="http://img706.imageshack.us/img706/9313/bqqb.png" border="0" />
(Strafer is my enemy sprite that I want the weaving to be implemented)
It seemed to work fine when I got rid of the A (period) and B (amplitude) modifiers and getting rid of lastX and lastY. Except when I try to modify its A and B, that's where it goes haywire.
I will post a video if you need/ don't quite understand what I am talking about.
Thanks : )