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 / Change gun in use

Author
Message
DarkApe
20
Years of Service
User Offline
Joined: 1st Jul 2003
Location:
Posted: 12th Mar 2004 22:45 Edited at: 13th Mar 2004 11:00
This is my first code doing something like this so I dont know how much it really sucks since I am just a begginer but the code is pretty short. what it does is when you press 1 or 2 more can be added but it hides the weapon and shows the new one

Plz rate my code I hope it helps some of you out there
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 13th Mar 2004 02:20
its bad practice to have, if inkey$()="1", and then the same thing on the next line, as if you pressed down "1", for the 1st inkey but it was release by the time it got to the 2nd inkey itwouldent run that code, so compact it. and to make adding guns easier

and i dont know what w1,w1 etc does, as it is irrelevant in your loop, same as your arrays.




thats the same code, but much simpler to add more guns, and is more efficient ingame

DarkApe
20
Years of Service
User Offline
Joined: 1st Jul 2003
Location:
Posted: 13th Mar 2004 10:56
well I am kind of newbie when it comes to new codes I have just used the more simple ones and the one I posted up there works without trouble for me and I still havent read on how to use the next i commands and stuff like that

w1=weapon 1 for when w1 = 1 then shows gun 1 if w2 = 1 then it shows the second gun and so on

Login to post a reply

Server time is: 2024-05-12 04:41:23
Your offset time is: 2024-05-12 04:41:23