Very much a beginner.
Gota start somewhere.
Thanks heaps.
here is what i came up with before. Got the door to open it just wouldn't stop opening.
______________________________________________________
Graphics3D 800,600,0,1
SetBuffer BackBuffer()
Global campivot
Global cam_col=1
Global room_col=2
Global door_col=3
Global door
Global door_open = False
Global door_y
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,4
camera=CreateCamera(campivot)
PositionEntity camera,EntityX(campivot),50,EntityZ(campivot)
EntityType camera,cam_col
Function opendoor()
If door_open=False dy=0
If EntityCollided (campivot,door_col) door_open=True
timer=MilliSecs()
dy=1
If door_open=True
MoveEntity door,0,dy,0
If MilliSecs() = Timer +2000 Then door_open = False
EndIf
End Function
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
opendoor()
UpdateWorld
RenderWorld
Flip
Wend
End
_____________________________________________________
Will go over your code & see how i go, probably tomorow.
Thanks again
Gota start somewhere.
Thanks heaps.
here is what i came up with before. Got the door to open it just wouldn't stop opening.
______________________________________________________
Graphics3D 800,600,0,1
SetBuffer BackBuffer()
Global campivot
Global cam_col=1
Global room_col=2
Global door_col=3
Global door
Global door_open = False
Global door_y
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,4
camera=CreateCamera(campivot)
PositionEntity camera,EntityX(campivot),50,EntityZ(campivot)
EntityType camera,cam_col
Function opendoor()
If door_open=False dy=0
If EntityCollided (campivot,door_col) door_open=True
timer=MilliSecs()
dy=1
If door_open=True
MoveEntity door,0,dy,0
If MilliSecs() = Timer +2000 Then door_open = False
EndIf
End Function
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
opendoor()
UpdateWorld
RenderWorld
Flip
Wend
End
_____________________________________________________
Will go over your code & see how i go, probably tomorow.
Thanks again