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.

Author
Message
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 13th Oct 2002 00:20
Can someone give me a code snippit in which it shows you how to load a gun (a cylinder will do) and load up x number of bullets and manipulate those bullets?

NOTE: x meaning as many bullets as I want...some guns fire faster then others...
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 13th Oct 2002 01:03
You'll have to set some kind of limit on the number of bullets you have at one time, and keep an array of data for their velocities.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 13th Oct 2002 02:04
duh...of course you have to do that...but I want the code snippit itself for I have never done it before

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Oct 2002 02:11
I wrote this off the top of my head, it should work, give it a try, it'll shoot 10 bullets repeatedly.



am I missing anything? That should work.
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 13th Oct 2002 02:18
Neat. Didn't think of doing it that way .

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Oct 2002 02:30
yeah, I was going insane trying to figure out a machine gun code. I stayed up all night and failed a history quiz drawing charts of where a bullet would be and if you were able to shoot the next one and when, then i thought of this and got really happy, cuase its waaay more simple than I had ever imagined.

That code does work right? The only problem with multiple bullets is that the game will lag with so much collision detection.
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 13th Oct 2002 04:23
Haven't tested, but it should, so if it doesn't, you've found another bug.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
TGWDNGHN
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 13th Oct 2002 21:03
BUGS! and not only that but i recommend you use an array for EVERYTHING in a games so you can change the laue of one thing without affecting another...for example...

without array:
I want to change the number of bullets for my player...but I can't increae it because an object with that number (lets say x+1)is already made...
array: my code has many algorithms with arrays so that if want to increase the number of bullets the proggram will handle the rest of the objects
Stupid example: I want to increse the number of bullets from 10 to 1000...arrays will take care of everything.....


hard to explain but thats the way it is...can someone please give me a WORKING piece of code WITH arrays?

(you did a nice job though...)

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 13th Oct 2002 23:30
you wouldn't have to worry about it being already made if you simply made a reserved area of numbers for bullets and set a max limit, say a number between 1 and 1000. An array would make it overly complicated...

Login to post a reply

Server time is: 2024-04-25 11:59:00
Your offset time is: 2024-04-25 11:59:00