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.

Code Snippets / 250 line code engine for 3rd person mouse controled game(DBP)

Author
Message
GOD
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: right there
Posted: 20th Jun 2004 05:15 Edited at: 20th Jun 2004 05:17
Well Ive been away from DBP for a few months because my comp was broken and I was to lazy to do anything about it. Well I got it fixed and as a warm up I decided to do this. Turned out I forgot that I wasnt great before so I ended up learning a good chunk of this while I wrote it. Its 248 lines of code for controlling a character in 3rd person with the mouse to turn. It includes:

Mouse controlled turning

Forward/backward + sidesteping using W,A,S,D keys.

Fully functional Gravity

Jumping

3 different type of movent(Standing,crouching,prone/on stomach)with correct speed and turning plus different sized objects.

Almost everything is in its own function except jumping and changing position, but is well organised,

rem's identifying everything.

Hope this will help some people out, have fun with it. The code is posted below. If you find any errors bugs, or if somthing is unclear just post and I will try to help out.

EDIT: sorry in the functions I did some bad spacing it doesnt change code, just a little harder to look at, nothing major ill post it in a code thing here:
Rknight
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: NJ
Posted: 20th Jun 2004 11:43
Very nice, neat, and quick.
aks74u
20
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: arizona
Posted: 21st Jun 2004 01:40
this kicka sss

mulletman47@aol.com
TooNRPG _dot_ tk
20
Years of Service
User Offline
Joined: 20th Jun 2004
Location:
Posted: 14th Jul 2004 03:59
It Sounds ok, but does anyone mind making me an exe since i don't have pro

=-D
Matinuker
20
Years of Service
User Offline
Joined: 25th Mar 2004
Location:
Posted: 15th Jul 2004 23:19
Hi, I am working on a new 3D engine but it is a bit crap and when you turn around and go upside down then it is compleately messed up. Maby someone could help me. I am not able to post the code but it uses an object to put in the position that the dot is in and then is finds the screen position.Then useing the array of dots it orders them closest to furthest and draws them from furthest to closest so it doesn't dodge up.

Paf
JARS
20
Years of Service
User Offline
Joined: 15th Jul 2004
Location:
Posted: 16th Jul 2004 07:03
Thanks for the code ! I was gonna make something of the kind, but it would be too time consuming in the current team project we're having so I'll just take yours and give you credit for it (Thanks, you spared me some time !)
http://members.shaw.ca/demon971/index3.html

That's where we'll be using it probably if you want to check it out and check if we actually credit you heh

J.A.R.S.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jul 2004 17:21
Though I don't find this as awsome as some others, (no offense) but your code is well organized and neatly indented.

"eureka" - Archimedes
Elron
20
Years of Service
User Offline
Joined: 22nd Jul 2004
Location: TX
Posted: 23rd Jul 2004 05:03
Nice code you have going there.
I compled and ran it and was wondering how i might go about adding a BSP level instead of the matrix in there now?
The reason i ask is that i am a Level Designer looking to make a stand alone .exe i can use to demo my work.
Any help in this area would be great.

"if it's not broke, i have not tried"

Login to post a reply

Server time is: 2024-11-23 19:27:34
Your offset time is: 2024-11-23 19:27:34