Does anyone know how to setup collisions with kfprimm's MaxB3D module or Warner's Engine module?
Here is an example of whats happening in my code:
Strict
Import maxb3d.drivers
Graphics 800, 600
Const TYPE_SP1 = 1
Const TYPE_SP2 = 2
Global light:TLight = CreateLight()
Global camera:TCamera = CreateCamera()
SetEntityRotation light, 90, 0, 0
Global sphere1:TMesh = CreateSphere()
SetEntityPosition sphere1, 2.5, 0, 5
SetEntityColor sphere1, 255, 0, 0
SetEntityType sphere1, TYPE_SP1
Global sphere2:TMesh = CreateSphere()
SetEntityPosition sphere2, -2.5, 0, 5
SetEntityColor sphere2, 0, 0, 255
SetEntityType sphere2, TYPE_SP2
While Not KeyHit(KEY_ESCAPE) And Not AppTerminate()
If KeyDown(KEY_LEFT) Then MoveEntity sphere1, -.1, 0, 0
If KeyDown(KEY_RIGHT) Then MoveEntity sphere1, .1, 0, 0
SetCollisions(TYPE_SP1,TYPE_SP2,2,2)
SetCollisions(TYPE_SP2,TYPE_SP1,2,2)
UpdateWorld
RenderWorld
Flip(True)
Wend
1. The spheres have no color after coloring them and 2. Collisions do not work until the sphere is right on top of the other sphere. Can someone please help?
thnx
Last edited 2012
|