I make a little expreiment with DP to see what can i do....
I make A character controller wich walks thru my little lvl.
There is one dynamic Box, but if i toch it there is nothing
And if i fall down its very slowly, if i press the upkey he fall down very fast
rem Init
Phy Start
sync on
sync rate 60
autocam off
ink rgb(255,255,255),0
global ammoID as integer
global mtimer as integer
ammoID=101
Make Object Box 5,50,1,50
Position Object 5,0,0,0
Phy Make Rigid Body Static Box 5
Make Object Box 6,50,1,50
Position Object 6,0,21.05,94.95
Phy Make Rigid Body Static Box 6
Make Object Box 7,50,1,50
Position Object 7,0,10.5,47.5
Xrotate Object 7,-25
Phy Make Rigid Body Static Box 7
w#=3 : h#=20
make object box 1, w#, h#, w#
phy make box character controller 1, 0, 20, 0, w#/2, h#/2, w#/2, 1, 1.5, 45.0
Hide Object 1
Make Object Box 100,10,10,10
Position Object 100,0,30,95
Phy Make Rigid Body Dynamic Box 100
rem Camera
position camera 0,10,-100
point camera 0,10,0
set normalization on
set ambient light 5
set directional light 0,0.2,-0.7,0.1
set camera range 1,15000
set camera fov 80
color backdrop 0
rem Schleife
do
rem Main
while ()=0
controlShooting()
REM Player Controll
if controlkey()
duck#=10
else
duck#=20
Endif
Scale Object 1,5,duck#,5
if upkey ( )
phy move character controller 1, 20.0
else
phy move character controller 1, 0.0
endif
inc anglea#,(mousemovex()*0.4)
inc angleb#,(mousemovey()*0.4)
Yrotate Camera anglea#
Xrotate Camera angleb#
Position Camera object position x(1),object position y(1)+10,object position z(1)
Yrotate Object 1,anglea#
phy update
sync
endwhile
Rem Ende
phy update
loop
function controlShooting()
if mouseclick()=1 and mtimer<timer() and ammoID<500
mtimer = timer()+500
angy# = camera angle y()
angx# = -camera angle X()
make object sphere ammoID,0.5,5,5
color object ammoID,0
position object ammoID,camera position x(),camera position y(),camera position z()
phy make rigid body dynamic sphere ammoID
phy set rigid body linear velocity ammoID, 150*sin(angy#)*cos(angx#),150*sin(angx#),150*cos(angy#)*cos(angx#)
phy set rigid body mass ammoID, 500
set object specular power ammoID, 255
set object ambient ammoID,0
If rlt#=30
rl#=1
rlt#=0
Endif
inc rlt#
inc ammoID
endif
endfunction