Complete collision, but how to 'walk'?
Blitz3D Forums/Blitz3D Beginners Area/Complete collision, but how to 'walk'?
| ||
Hello, sorry for bothering you about the collision, I finally got it working. Now I need to make the camera (player) have gravity effect, walking movement... I've tried but seem no result... A little help? There the whole code: Graphics3D 1600,900 SetBuffer BackBuffer() HidePointer AppTitle "Trail - " type_scene = 1 type_camera = 2 type_plant = 3 camera = CreateCamera() CameraClsColor camera,0,0,55 PositionEntity camera,0,2.0,-7.0 CameraFogRange camera,1,30 EntityType camera,type_camera EntityRadius camera,2,1.25 light = CreateLight() scene = LoadMesh("Mesh/4th.b3d") EntityType scene,type_scene EntityRadius scene,1 plant = LoadMesh("Mesh/Plant01a.3ds") ScaleMesh plant,0.04,0.04,0.04 PositionEntity plant,-5,0,2 EntityType plant,type_plant EntityRadius plant,3 CCTV = LoadMesh("Mesh/cam01.3ds") ScaleMesh CCTV,0.04,0.04,0.04 PositionEntity CCTV,-12,3.4,-23 RotateMesh CCTV,-10,-210,0 While Not KeyDown(1) Collisions type_camera,type_scene,2,2 Collisions type_camera,type_splant,3,3 ;if [condition] then [do something] If KeyDown(30) Then MoveEntity camera,-0.025,0,0 ;right If KeyDown(32) Then MoveEntity camera,0.025,0,0 ;left If KeyDown(17) Then MoveEntity camera,0,0,0.1 ;forward If KeyDown(31) Then MoveEntity camera,0,0,-0.07 ;backward If KeyDown(57) Then TranslateEntity camera,0,0.1,0 ;up If KeyDown(42) Then TranslateEntity camera,0,-0.1,0 ;down mxs# = mxs# + MouseXSpeed() mys# = mys# + MouseYSpeed() If mxs# > 360 Then mxs# = 0 If mxs# < 0 Then mxs = 360 If mys# > 80 Then mys# = -80 If mys# < -80 Then mys = 80 RotateEntity camera,mys#,-mxs,0 MoveMouse 800,450 If MouseDown(3) Then MoveEntity camera,0,0,0.1 If KeyDown(15) WireFrame(True) Else WireFrame(False) EndIf UpdateWorld RenderWorld Flip Wend Thank you for your time reading this. |