How to make my bullet fire , right now its just at the position in front of my ship.
Thanks
SetVirtualResolution (1024, 768)
SetDisplayAspect(4.0 / 3.0)
SetWindowSize(1024, 768, 0)
SetWindowTitle("Shooter Game")
LoadImage (1, "dark_blue.jpg")
Createsprite(1, 1)
LoadImage(2, "ship13.png")
CreateSprite(2, 2)
SetSpritePosition(2, 512, 768)
AddVirtualJoystick(3, 950, 700, 100)
LoadImage(4, "enemy.png")
CreateSprite(4, 4)
SetSpritePosition(4, 512, 0)
LoadImage(5, "missle.png")
AddVirtualButton(6, 60, 700, 100)
SetVirtualButtonText(6, "Fire")
do
joystickX# = GetVirtualJoystickX ( 3 )
joystickY# = GetVirtualJoystickY ( 3 )
x# = GetSpriteX ( 2 )
y# = GetSpriteY ( 2 )
SetSpritePosition ( 2, GetSpriteX ( 2 ) + ( joystickX# / 0.3 ), GetSpriteY ( 2 ) + ( joystickY# / 0.3 ) )
if GetSpriteY( 2 ) < 0
SetSpriteY( 2, 0)
endif
if GetSpriteX( 2 ) < 0
SetSpriteX( 2, 0)
endif
if GetSpriteX( 2 ) + GetSpriteWidth( 2 ) > GetVirtualWidth()
SetSpriteX( 2, GetVirtualWidth() - GetSpriteWidth( 2 ) )
endif
if GetSpriteY ( 2 ) + GetSpriteHeight ( 2 ) > GetVirtualHeight()
SetSpriteY (2, GetVirtualHeight() - GetSpriteHeight ( 2 ))
endif
if GetVirtualButtonState( 6 ) = 1
CreateSprite ( 5, 5 )
SetSpritePosition(5, x# +27, y# +2)
endif
sync()
loop