Worked out how to use treeparty a bit, I have a tree situated above the ground ready to drop to ground. Haven't done the collision bit yet but I can't seem to get the tree to drop yet. Can you look at my code and tell me why it's not dropping. Thanks.
Graphics3D 800,600,16,1
SetBuffer BackBuffer()
Include "Include_treeParty.bb"
tpLoadEngine()
tree=tpLoadtree("tree1.tp",2)
PositionEntity tree, Rnd(-10,0),12,Rnd(-10,10)
Function touchground(n$)
If Not EntityCollided (n$,ground)
PositionEntity (n$,EntityX(n$),EntityY(n$)-0.1,EntityZ(n$))
End If
End Function
Cam=CreateCamera()
PositionEntity Cam,0,4,-20
light=CreateLight()
ground=CreateTerrain(512)
PositionEntity ground, -500,0,-500
ScaleEntity ground, 10,15,10
tex=LoadTexture( "greenery.jpg" )
EntityTexture ground, tex
While Not KeyDown( 1 )
touchground(tree)
If KeyDown( 205 )=True Then TurnEntity cam,0,-1,0
If KeyDown( 203 )=True Then TurnEntity cam,0,1,0
If KeyDown( 208 )=True Then MoveEntity cam,0,0,-0.05
If KeyDown( 200 )=True Then MoveEntity cam,0,0,0.05
If KeyDown( 30 )=True Then MoveEntity cam,.3,0,0
If KeyDown( 44 )=True Then MoveEntity cam,-.3,0,0
If KeyDown( 31 )=True Then TurnEntity������������������������������������������������������������������������������������������������������������������������������������
Graphics3D 800,600,16,1
SetBuffer BackBuffer()
Include "Include_treeParty.bb"
tpLoadEngine()
tree=tpLoadtree("tree1.tp",2)
PositionEntity tree, Rnd(-10,0),12,Rnd(-10,10)
Function touchground(n$)
If Not EntityCollided (n$,ground)
PositionEntity (n$,EntityX(n$),EntityY(n$)-0.1,EntityZ(n$))
End If
End Function
Cam=CreateCamera()
PositionEntity Cam,0,4,-20
light=CreateLight()
ground=CreateTerrain(512)
PositionEntity ground, -500,0,-500
ScaleEntity ground, 10,15,10
tex=LoadTexture( "greenery.jpg" )
EntityTexture ground, tex
While Not KeyDown( 1 )
touchground(tree)
If KeyDown( 205 )=True Then TurnEntity cam,0,-1,0
If KeyDown( 203 )=True Then TurnEntity cam,0,1,0
If KeyDown( 208 )=True Then MoveEntity cam,0,0,-0.05
If KeyDown( 200 )=True Then MoveEntity cam,0,0,0.05
If KeyDown( 30 )=True Then MoveEntity cam,.3,0,0
If KeyDown( 44 )=True Then MoveEntity cam,-.3,0,0
If KeyDown( 31 )=True Then TurnEntity������������������������������������������������������������������������������������������������������������������������������������