I have used this code to control the player, as taken from an example posted on here:
jx# = GetVirtualJoystickX( 1 )
jy# = GetVirtualJoystickY( 1 )
angle# = atanfull(jx#,jy#)
shipAngle# = getSpriteAngle( playersprite )
diffAngle# = wrap180( angle# - shipAngle# )
newAngle# = shipAngle# + diffAngle#*0.1
setSpriteAngle( playersprite, newAngle# )
I am using physics with gravity of 0,0 so I can have a gauntlet game type movement, but what I want to know is how do you fire a bullet at the angle the player is at?, I an get the angle of the player using more code from here
this is my function for shooting a bullet,or trying to!
function make_player_bullet(px#,py#)
idbullet=createsprite(10)
xv#=GetSpritePhysicsVelocityx(playersprite)
yv#=GetSpritePhysicsVelocityy(playersprite)
vangle#=atanfull(xv#,yv#)
yf#=sin(vangle#)
setspriteangle(idbullet,vangle#)
setspriteposition(idbullet,px#,py#)
setspritesize(idbullet,32,32)
setspriteshape(idbullet,3)
setspritephysicson(idbullet,2)
setspritegroup(idbullet,10)
SetSpritePhysicsforce(idbullet,getspritex(idbullet),getspritey(idbullet),0,yf#*20000)
//setspritephysicsimpulse(idbullet,getspritex(idbullet),getspritey(idbullet),getspritephysicsvelocityx(idbullet),20000)
endfunction
neither force or impulse seen to do what I need
Hail to the king, baby!