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.

DarkBASIC Discussion / Full Gun Code.

Author
Message
Evil Inside
19
Years of Service
User Offline
Joined: 1st Jun 2005
Location:
Posted: 3rd Jun 2005 07:40
Hi,

Please can anyone give/help me with a full gun code? By full gun code, I mean:

>Posistioned Gun
>Shooting
>Gun A.I. etc.

It's for an FPS (duh!)

'I Would Give It 5 Minutes If I were You...' - Somebody... -
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 3rd Jun 2005 10:26 Edited at: 3rd Jun 2005 10:34
Evil Inside,

Let's start with the bullets part of the gun. Below I have placed a code snippet of a fully runnable program. It is 2D, and completely convertable to 3D, just by adding a third dimension. The first dimension holds the bullets' x positions, second their y position, third their angle of movement, and fourth their bulletlife.

I have calculated how many bullets(array slots) I need in order that the bullets do no 'run out'. To say otherwise, that the bullets will keep a consitent flow with no funky gaps. The code is heavily commented, hopefully enough for you to understand its processes. If you do not, just ask a specific question or more, and I will help you to understand. Enjoy.

I have made an array, which has sixty slots, and four dimensions in each slot.



+NanoBrain+
Evil Inside
19
Years of Service
User Offline
Joined: 1st Jun 2005
Location:
Posted: 3rd Jun 2005 18:57
Heh Heh

Very Nice

Ta very much!

-- EVIL INSIDE PENTIUM 666 666.0Ghz || 4GB DDR RAM || 80GB HARD DRIVE || WINXP PRO ||

Login to post a reply

Server time is: 2025-05-22 20:23:55
Your offset time is: 2025-05-22 20:23:55