need to open a door

Blitz3D Forums/Blitz3D Beginners Area/need to open a door

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hello All.

I have just purchaced blitz 3d & have been playn around with the demo for a while but haven't realy done any programing since the days of the good old C64.

I am trying to make a door slide open & can't quite figure it out. I have managed to make it open although i can't move the camera around when the door opens. I know the reason why it is doing this. Can anyone help me make the door open while i can still move the camera around.

Any help would be appreciated.

here is the code

Graphics3D 800,600,0,1

SetBuffer BackBuffer()


Global door
Global cam_col=1
Global room_col=2
Global door_col=3

Collisions Cam_col,room_col,2,2
Collisions cam_col,door_col,2,2

light=CreateLight()

room=LoadMesh ("cube1.b3d")
PositionEntity room,0,-100,0
EntityType room,room_col

door=LoadMesh ("door.b3d")
PositionEntity door,0,-100,200
ScaleEntity door,1,1,.3
EntityType door,door_col

campivot=CreatePivot()
EntityType campivot,cam_col
EntityRadius campivot,3

camera=CreateCamera(campivot)
PositionEntity camera,0,50,0
EntityType camera,cam_col

While Not KeyDown (1)

TranslateEntity campivot,0,-.5,0

If KeyDown (203)
TurnEntity campivot,0,1,0
ElseIf KeyDown (205)
TurnEntity campivot,0,-1,0
End If
If KeyDown (208)
TurnEntity camera,1,0,0 ElseIf KeyDown (200)
TurnEntity camera,-1,0,0
EndIf
If KeyDown (30)
MoveEntity campivot,0,0,1
ElseIf KeyDown (44)
MoveEntity campivot,0,0,-1
EndIf

If EntityCollided (campivot,door_col)
timer=MilliSecs()
While MilliSecs() <timer+2000
MoveEntity door,0,+1,0
UpdateWorld
RenderWorld 2
Flip
Wend
EndIf

UpdateWorld

RenderWorld
Flip

Wend