At the moment i'm trying to shoot a sphere and make it go in a straight line without dipping because of gravity, and still shooting where i point. I tried using kinematic rigid bodies but i cant change the angle it's going.
code so far
REM Project: shoot test
REM Created: 11/06/2007 16:47:55
REM
REM ***** Main Source File *****
REM
sync on
sync rate 60
autocam off
phy start
set camera range 0.5, 30000
hide mouse
SET DISPLAY MODE SCREEN WIDTH(),SCREEN HEIGHT(),SCREEN DEPTH()
load image "fire.png",1
load image "grass.jpg",2
load image "wood.jpg",3
` Make Floor
Make Object Box 1,3000,100,3000
Position object 1,0,-object size y(1)/2,0
color object 1,RGB(255,0,0)
Texture Object 1,2
Phy make rigid body static box 1
` make player
make object box 2, 20, 50, 20
position object 2,0,50,0
phy make box character controller 2, 0, 50, 0, 10, 35, 10, 1, 10.5, 45.0
hide object 2
`make cubes
Make Object Box 3,20,20,20
Position Object 3,0,object size y(3)/2,100
color object 3,rgb(0,255,0)
texture object 3,3
phy make rigid body dynamic box 3
do
phy set gravity 0,-10,0
circle screen width()/2,screen height()/2,15
Set cursor 0,0
PRINT "FPS: " + str$(Screen FPS())
PRINT "Aim at the box and left click to set it on fire"
position camera object position x ( 2 ), object position y ( 2 ) + 20, object position z ( 2 )
rotate camera object angle x ( 2 ), object angle y ( 2 ), object angle z ( 2 )
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = wrapvalue ( CameraAngleY# + mousemovex ( ) * 0.4 )
CameraAngleX# = wrapvalue ( CameraAngleX# + mousemovey ( ) * 0.4 )
yrotate object 2, curveangle ( CameraAngleY#, OldCamAngleY#, 24 )
xrotate object 2, curveangle ( CameraAngleX#, OldCamAngleX#, 24 )
key = 0
if upkey ( )
key = 1
phy move character controller 2, 100.0
endif
if downkey ( )
key = 1
phy move character controller 2, -100.0
endif
if key = 0
phy move character controller 2, 0.0
endif
IF MOUSECLICK()=1
if object exist(5)=0
make object sphere 5,5
position object 5,camera position x(),camera position y()-10,camera position z()
color object 5,rgb(255,0,0)
rotate object 5,CAMERA ANGLE X(),CAMERA ANGLE y(),CAMERA ANGLE z()
phy make rigid body dynamic sphere 5
phy set rigid body kinematic 5,1
phy set rigid body kinematic rotation 5,CAMERA ANGLE X(),CAMERA ANGLE y(),CAMERA ANGLE z()
endif
endif
IF phy get rigid body exist(5)=1
phy set rigid body kinematic position 5,object position x(5),object position y(5)-2,object position z(5)+((180/camera angle x())*-1)
endif
phy update
sync
loop