Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Please Help ! Fps Game

Author
Message
Caboose
19
Years of Service
User Offline
Joined: 18th May 2005
Location: In A pie
Posted: 28th May 2005 20:56
Hi guys At thegamecreators, i need your help!
i have a few things

1. recoil, ill give u my whole game code at the bottom, i dont think my fps is coded the way it should be, how can i make my gun look as if it were fireing!?

2.Gun Swaying, iv tried a few things that just dident work, and tutorials, i need it to look like the guy is running !

3. How Do I place Buildings In Certain Areas? Because I have A Bunker n Stuff N i just Dont know how to put it in the game where i want

4.Enemys, AI, i would like to put enemys in it, but have ai so that they dont see me from behind

5.Whats the code for not letting my guy go out of the play area?

heres my game code



I would really aprecciate all replys
thanks
dan

To truely Pwn, You have to pwn in all games
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 29th May 2005 01:14
for recoil, you could just use X Rotate Object 1, wrapvalue( Object Angle X( 1 ) + 5 )
That will make the gun jump upwards. Then you do the same with the camera.
As for loading building in the correct locations, you could try either using position object for each building, or storing all the coordinates in a text file, then opening the file, getting the positions and then using Position Object. This way is much better than using Position Object in the code for each building, but might be a bit harder.
As for keeping your player within the play area, you could check his X position, see if it's not in the play area ( if x < 50 or x > 100 ) and reposition him to his last valid position ( position object PlayerNum, oldX, oldY, oldZ )
Then do the same thing for Z.

James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 29th May 2005 01:42
I would do the same as TKF15H with the recoil and buildings
xRotate object objectNO,angle
Rotate object objectNO,angleX,angleY,angle,Z
Position Object objectNO,positionX,positionY,positionZ


For the play area, this is both simple and complex:
When it comes to simple boundries then you just need a very simple set of If statements
If positionX < 0 then positionX = 0
If positionX > 5000 then positionX = 5000
If positionZ < 0 then positionZ = 0
If positionZ > 5000 then positionZ = 5000

Just change the values to suit your game.

However, for collision this is much more complex, either code your game with MANY boundries like the ones above or try and figure out your own collision functions. You can also use DB built in collisions but this is fairly slow.


For gun swaying, I've never tried it myself but if you were to figure out if the object is swaying left or right, move the object in that direction until a certain point, then change direction and move the object in that direction until a certain point.
Sorry I havent produced you any code but I dont really have time right now + it will depend on how you position your gun in the world.


James

Hello!
Caboose
19
Years of Service
User Offline
Joined: 18th May 2005
Location: In A pie
Posted: 30th May 2005 07:52
yeah im pritty slow n dident understand most of that

the recoil thing dident work, with sucked cause it sounded like it would work, so if u cud give me a bell if u hav any more ideas?

oh can u please base ur answers on the code snippet at the top
would be easyer for me, thanks

dan

To truely Pwn, You have to pwn in all games

Login to post a reply

Server time is: 2024-09-23 21:20:21
Your offset time is: 2024-09-23 21:20:21