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.

Dark GDK / First Person Shooter coding help

Author
Message
danm36
16
Years of Service
User Offline
Joined: 13th Jan 2008
Location:
Posted: 25th Oct 2008 16:45
I need some help on coding a shooter. I have got it generally set up but I need help on multiple weapons and animations. O.K.

First Question: I have found out that DarkGDK cant read animations if they begin with 0 and have an 8 in them. What I need, is to be able to define animation numbers and object num in the weapon_*weapon-name*.cpp which can be called in the main loop using dbLoopAnimation( WeaponNum, AnimStart, AnimEnd) yet I do not know how to change variables from different CPP files.

Second Question: How can I set up a system to change weapons?

Thats for now. I will ask for more help later.

I would like to learn how to code:

3rd person in the style of MGS, 1st/3rd person interchangeable modes in the style of MGS2
drusepth
15
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 26th Oct 2008 01:52
Quote: "Second Question: How can I set up a system to change weapons?"


I'm new to game theory as well (luckily not new to programming) but I would assume that you would have a variable containing the current weapon you have. From there, you'd be able to load your animation numbers and objects based on the value of that variable. You'd also be able to change weapons, for example if the user pressed the right arrow key, switch to a secondary weapon. (if ( dbRightKey ( ) ) { weapon = 3; } or weapon = 'Pistol', however you wish to keep things organized.

You're not just limited to just the right arrow key; if you have 8 weapons, set the condition to change to each weapon for the keys 1-8 being pressed. Want to switch to the next/previous weapon? If the user presses the [Right arrow], do a weapon++ or something.

Login to post a reply

Server time is: 2024-09-30 09:24:01
Your offset time is: 2024-09-30 09:24:01