Chase Cam HELP

Blitz3D Forums/Blitz3D Beginners Area/Chase Cam HELP

NerdyBrendan(Posted 2010) [#1]
i, I am making a third person role playing game and I want to know how to add a chase cam to "player".

Here is the code:

Graphics3D 1024,768,32,1
SetBuffer BackBuffer()

Include "settings.bb"

AmbientLight 255,255,255

light=CreateLight()

world=createplane()
PositionEntity world,0,-20,0
EntityColor world,0,255,0



sky=CreatePlane()
RotateEntity sky,0,0,180
PositionEntity sky,0,100,0
EntityColor sky,0,255,255
;Camera

Global camera=CreateCamera()
CameraViewport camera,50,50,GraphicsWidth()/1.25,GraphicsHeight()/1.25


Global player=CreateCube()

	
	;Positioning
	PositionEntity player,0,0,5

;collisions
EntityType player,1
EntityRadius player,1.0
EntityType world,2

Collisions 1,2,2,2



gravity#=.05
yvel#=0


While Not KeyDown(1)
	

	If KeyDown(17)
		MoveEntity player,0,0,0.15
	
	EndIf
	If KeyDown(31)
		MoveEntity player,0,0,-0.15
		
	EndIf
	If KeyDown(30)
		TurnEntity player,0,2,0
		
	EndIf
	If KeyDown(32)
		TurnEntity player,0,-2,0
		
	EndIf 
	
	If KeyHit(57)
	FlushKeys()
		yvel=.5
	EndIf
	
If EntityCollided(player,world) Then 
	yvel = 0
	Else yvel = yvel - gravity
	EndIf
	
TranslateEntity player,0,yvel,0,True


	
	
	;End stuff

FlushKeys()
UpdateWorld
RenderWorld
Flip

Wend
End



If you can help, thanks. If not, oh well.


Who was John Galt?(Posted 2010) [#2]
Hi Rez,

take a look at the mario clone code that comes with B3D. It has a decent chase cam and it should be fairly easy to cut and paste into your code.


Kryzon(Posted 2010) [#3]
It has a decent chase cam and it should be fairly easy to cut and paste into your code.

Ouchy!


Who was John Galt?(Posted 2010) [#4]
LOL... I wasn't actually trying to be catty with that comment. It should show him everything he needs.


NerdyBrendan(Posted 2010) [#5]
Thanks.........