I'm sure this is pretty simple, but I can't seem to figure out why the block in this example keeps falling through the floor. Shouldn't the collision detection stop it?
Graphics3D 800,600
SetBuffer BackBuffer()
WBuffer False
HidePointer
SeedRnd MilliSecs()
Global camera
Global Level_Model
Global Char_Pivot
Global Char_Model
Const TYPE_CHAR=1,TYPE_CHAR_JUMPBOX=2
Const TYPE_LEVEL=10
Collisions TYPE_CHAR,TYPE_LEVEL,2,2
Collisions TYPE_CHAR_JUMPBOX,TYPE_LEVEL,2,2
;frametweening
Global gameFPS = 60
Global framePeriod = 1000 / gameFPS
Global frameTime = MilliSecs () - framePeriod
framePeriod = 1000 / gameFPS
frameTime = MilliSecs () - framePeriod
;Load_Level
Load_Arena()
Load_Char()
While Not KeyDown(1)
Move_Char()
RenderWorld
Flip
Wend
Function Load_Arena()
Level_Model=CreateCube()
ScaleEntity Level_Model,20,1,10
EntityType Level_Model,TYPE_LEVEL
EntityPickMode Level_Model,2
light=CreateLight(1)
RotateEntity light,30,20,0
camera=CreateCamera()
CameraClsColor camera,25,50,75
CameraZoom Camera,3
PositionEntity camera,0,12,-50
End Function
Function Load_Char()
Char_Pivot=CreatePivot()
PositionEntity Char_pivot,0,12,0
EntityRadius Char_Pivot,8,13
ScaleEntity Char_Pivot,.5,.5,.5
EntityType Char_Pivot,TYPE_CHAR
Char_Model=CreateCube(Char_Pivot)
EntityColor Char_Model,50,0,0
End Function
Function Move_Char()
MoveEntity Char_Pivot,0,-.1,0
End Function
Graphics3D 800,600
SetBuffer BackBuffer()
WBuffer False
HidePointer
SeedRnd MilliSecs()
Global camera
Global Level_Model
Global Char_Pivot
Global Char_Model
Const TYPE_CHAR=1,TYPE_CHAR_JUMPBOX=2
Const TYPE_LEVEL=10
Collisions TYPE_CHAR,TYPE_LEVEL,2,2
Collisions TYPE_CHAR_JUMPBOX,TYPE_LEVEL,2,2
;frametweening
Global gameFPS = 60
Global framePeriod = 1000 / gameFPS
Global frameTime = MilliSecs () - framePeriod
framePeriod = 1000 / gameFPS
frameTime = MilliSecs () - framePeriod
;Load_Level
Load_Arena()
Load_Char()
While Not KeyDown(1)
Move_Char()
RenderWorld
Flip
Wend
Function Load_Arena()
Level_Model=CreateCube()
ScaleEntity Level_Model,20,1,10
EntityType Level_Model,TYPE_LEVEL
EntityPickMode Level_Model,2
light=CreateLight(1)
RotateEntity light,30,20,0
camera=CreateCamera()
CameraClsColor camera,25,50,75
CameraZoom Camera,3
PositionEntity camera,0,12,-50
End Function
Function Load_Char()
Char_Pivot=CreatePivot()
PositionEntity Char_pivot,0,12,0
EntityRadius Char_Pivot,8,13
ScaleEntity Char_Pivot,.5,.5,.5
EntityType Char_Pivot,TYPE_CHAR
Char_Model=CreateCube(Char_Pivot)
EntityColor Char_Model,50,0,0
End Function
Function Move_Char()
MoveEntity Char_Pivot,0,-.1,0
End Function