Have got a ghost enemy in my game and am trying to get the movement right. Sinewave obviously gives quite a nice floating effect, however when the enemy hits a wall I need it to change direction (ie if he hits a south wall go off at any random angle between 270 to 90) and bounce doesn't seem to work (created a wall and the enemy just goes right through instead of bouncing off)
Is there a way to do this with sinewave or am i better getting the maths books out!?
Well, you can't combine sinewave movement with bouncing ball if that's what you're trying to do. It's either fully custom, fully built-in movement, or a heck lot of bugs. Codemonkey's solution is the easiest
Also, one problem with doing it with sinewave is that you're actually making him change position, not just making him look like he is. So, he'll be bumping into things a lot.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.