ok I think I can help here, here is a pace of code that I was working on about a year or so ago
sync on :sync rate 100
autocam off
hide mouse
backdrop on
color backdrop rgb(0,0,0)
phy start
load image "bana01.jpg",1
` make a box as a holder for the banner
make object box 2, 20, 1, 1
position object 2, 0, 6.5, 20
hide object 2
phy make rigid body static box 2
` make our cloth
phy make cloth 3
phy set cloth dimensions 3, 5, 20, 0.2
phy set cloth position 3, 3, 7.1, 20
phy set cloth rotation 3, 90, 0, 180
phy set cloth friction 3, 1.0
phy set cloth tearing 3, 1
phy set cloth tear factor 3, 2.5
phy build cloth 3
phy attach cloth to shape 3, 2, 1
texture object 3,1
`SET REFLECTION SHADING ON 3
` set up some variables
ID=300
currentime = timer()
lasttime = 0
do
`************************************************************
remstart
`*** ***
Tiph = Tiph + 1
if Tiph >= 5
camX# = camera angle x()
camY# = camera angle y()
camZ# = camera angle z()
Tiph = 0
endif
`*** ***
if camera angle x() > camX# then Phx1 = 1 :TPhx1 = 1
if camera angle x() < camX# then Phx1 = 2 :TPhx1 = 1
if TPhx1 > 0
if Phx1 = 1 then PHangX#=PHangX#+1.0 :TPhx1 = 0
if Phx1 = 2 then PHangX#=PHangX#-1.0 :TPhx1 = 0
endif
if TPhx1 = 0 then Phx1 = 0
`*** ***
if camera angle y() > camY# then Phy1 = 1 :TPhy1 = 1
if camera angle y() < camY# then Phy1 = 2 :TPhy1 = 1
if TPhy1 > 0
if Phy1 = 1 then PHangY#=PHangY#+1.0 :TPhy1 = 0
if Phy1 = 2 then PHangY#=PHangY#-1.0 :TPhy1 = 0
endif
if TPhy1 = 0 then Phy1 = 0
`*** ***
set cursor 20,20 :print PHangX#;" ";camera angle x()
set cursor 20,40 :print PHangY#;" ";camera angle y()
set cursor 20,60 :print Phx1
set cursor 20,80 :print Phy1
set cursor 20,100 :print TPhx1
set cursor 20,120 :print TPhy1
remend
`***********************************************************
`*** camera positonng ***
x# = camera position x()
z# = camera position z()
y# = camera position y()
remstart
angX# = camera angle x()
angY# = camera angle y()
angZ# = camera angle z()
remend
`if upkey()=1 then move camera 0,1.5
`if downkey()=1 then move camera 0,-1.5
` if rightkey()>0 then move camera 1.5
` if leftkey()>0 then move camera 1.5
rem camera rotation
yrotate camera camera angle y() + mousemovex()*0.3
xrotate camera camera angle x() + mousemovey()*0.3
rem stops mouse from going upside down
if wrapvalue(camera angle x(0))>100 and wrapvalue(camera angle x(0))<120 then xrotate camera 0,100
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
rem camera position
position camera x#,y#,z#
if mouseclick()=2 then move camera 0,-1.5
if upkey()=1 then move camera 0,1.5
if downkey()=1 then move camera 0,-1.5
`*** shooter ***
gosub shooter
for c = 300 to ID
if object exist(c)=1
Xpos#=object position x(c)
Ypos#=object position y(c)
Zpos#=object position z(c)
position object c,Xpos#,Ypos#,Zpos#
SQpos# = sqrt((Xpos# - camera position x())^2 + (Ypos# - camera position y())^2 + (Zpos# - camera position z())^2)
if SQpos# > 500 then hide object c
endif
next c
`*** update phyics ***
phy update
`*** end loop ***
sync
loop
`*** fire balls ***
shooter:
if speed# >= 300 then speed# = 300
if speed# <= 25 then speed# = 25
if spacekey()=1 then speed#=speed#+1
if returnkey()=1 then speed#=speed#-1
tisp=tisp+1
if spacekey()=0 then if tisp >= 25 then speed#=speed#-1 :tisp = 0
set cursor 20,20 : print "fire speed :";speed#
if mouseclick()=1
if (currenttime-lasttime) > 1000
angy# = camera angle y()
angx# = -camera angle X()
make object sphere ID,1
`scale object ID,25,25,25
position object ID,camera position x(),camera position y(),camera position z()
phy make rigid body dynamic sphere ID
phy set rigid body linear velocity ID,speed#*sin(angY#)*cos(angX#),speed#*sin(angX#),speed#*cos(angY#)*cos(angX#)
inc ID
lasttime = timer()
endif
endif
currenttime = timer()
return
`*** end phy ***
phy end
[img]null[/img][img]F:\Projects\Physic's projects\bana01.jpg[/img]
hope it helps I've added a texture to sweeten the deal, if you use this image in your games please give me credit for it, thats all I ask, and if any one could help me with my problem witch I've posted at http://forum.thegamecreators.com/?m=forum_view&t=127692&b=30
hope this helps
From the dark and in to the light, twisted the body of madness, dark souls to only the one who would be called, Death lord of the dead, king of the forgotten, keep of lost souls.