Making angled Cos And Sin Waves Anyideas?
BlitzMax Forums/BlitzMax Beginners Area/Making angled Cos And Sin Waves Anyideas?
| ||
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 |
| ||
You want a bullet that moves in a wave like fashion along a specific angle? |
| ||
yes i think I almost got it working nowGraphics 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 |
| ||
Does Anybody know of any easyer way to do the above calculations |
| ||
Finally Got it Working happy with the results thanks all :) ![]() |
| ||
neat |