Making angled Cos And Sin Waves Anyideas?

BlitzMax Forums/BlitzMax Beginners Area/Making angled Cos And Sin Waves Anyideas?

Duckstab[o](Posted 2005) [#1]
Im Creating A SpaceShooter and workin on paths for bullets at the moment

I have managed to Create A bullet Which Travels At Any angle and A Bullet Which Travel In a Wave From left to Right

But the Next Step is To Create A Wave bullet that travels In Any Direction 0 to 360 degrees

Try as i Might The math is lost to me

any ideas welcome cheers


LeisureSuitLurie(Posted 2005) [#2]
You want a bullet that moves in a wave like fashion along a specific angle?


Duckstab[o](Posted 2005) [#3]
yes i think I almost got it working now
Graphics 800,600
Gspeed#=10
Speed#=3
Rot#=90 'direction
Rot2#=0 'Wave dont change
Size#=50 'Wave Size
sincoor#=512 'starting coords
coscoor#=512 ' " " " " " " " " "

While Not KeyHit(KEY_ESCAPE)
Rot2#:+2
Distance#:+(Speed#/Gspeed)
waver=Size#*Sin(Rot2#)
XCoor#=(Sincoor#+(Distance#*Cos(-90+Rot#)))+(Waver*(Cos(-180+Rot#)))
Ycoor#=(Coscoor#+(Distance#*Sin(-90+Rot#)))+(Waver*(Sin(-180+rot#)))
DrawOval xcoor#,ycoor#,10,10
Flip
Wend 

End



Duckstab[o](Posted 2005) [#4]
Does Anybody know of any easyer way to do the above calculations


Duckstab[o](Posted 2005) [#5]
Finally Got it Working happy with the results

thanks all :)




ImaginaryHuman(Posted 2005) [#6]
neat