Third person game
Blitz3D Forums/Blitz3D Beginners Area/Third person game
| ||
Hi I was just wandering if you could please help me with a third person shoot/beat em up game. |
| ||
What do you need help on? |
| ||
Well basicly how to make the character in the view like in oni and that the camera that is behind the player if it collides with the wall will slide along it with out going into the wall and making it see through. goober |
| ||
well, mkae your camera have an entitytype and use the collisions command to set up collisions between the camera and the wall |
| ||
here's some code. the cmaera smoothness part is taken from dr av's camera system, so give credit to him if you use it. i might be wrong tho :)Graphics3D 800,600 SetBuffer BackBuffer() camera=CreateCamera() EntityType camera,1 CameraRange camera,0.1,100 light=CreateLight() TurnEntity light,45,30,0 wall1=CreateCube() ScaleEntity wall1,15,3,1 PositionEntity wall1,0,0,-15 EntityType wall1,2 EntityColor wall1,50,50,200 wall2=CreateCube() ScaleEntity wall2,15,3,1 PositionEntity wall2,0,0,15 EntityType wall2,2 EntityColor wall2,50,50,200 wall3=CreateCube() ScaleEntity wall3,1,3,15 PositionEntity wall3,15,0,0 EntityType wall3,2 EntityColor wall3,50,50,200 wall4=CreateCube() ScaleEntity wall4,1,3,15 PositionEntity wall4,-15,0,0 EntityType wall4,2 EntityColor wall4,50,50,200 Collisions 1,2,2,3 campivot=CreatePivot() player=CreateCone() EntityParent campivot,player PositionEntity campivot,0,0,-7 EntityType player,1 While Not KeyHit(1) If KeyDown(200) Then MoveEntity player,0,0,0.1 If KeyDown(208) Then MoveEntity player,0,0,-0.1 If KeyDown(203) Then TurnEntity player,0,1,0 If KeyDown(205) Then TurnEntity player,0,-1,0 Gosub updatecamera UpdateWorld RenderWorld Flip Wend End .updatecamera PointEntity camera,campivot MoveEntity camera,0,0,EntityDistance(camera,campivot)/10 PointEntity camera,player Return |
| ||
look for jhockings post in either user creations or user projects which i think is called ninja test demo, has a basic 3rd person camera in that. |
| ||
joker the code is good apart from having no gravity in it and not being able to jump and move up stairs and stuff cause i'm not that good at gravity but thanks for the help so far. sinu i found the code but it is not any use to me cause the views are messed up init and also the camera goes frew the wall and the movement is based on the camera so the player rotates in a funny way. thanks so far. |
| ||
kwl i lnow i didn't ask for it but thanks for the refrence |
| ||
Hi again just wandering if there is any other examples of a third person game cause the ninja test didn't realy help much i dont mean to be annoying but is there any tutorial that tell as well as show how to make a third person shoot em up and beat em up game where you can get items ond other things like that cause i am looking at the code to see weather i can learn from it and the ninja test did not make much sense even though it is a good way to show how that game came be make in blitz. |
| ||
some tips: parent the camera to a pivot which is in turn parented to the main mesh. |
| ||
Have a look at this: http://www.blitzbasic.com/bbs/posts.php?topic=24975 |