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.

Newcomers DBPro Corner / Optimizing code / function help

Author
Message
Teh Stone
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 26th Jan 2010 18:26
Ive been writing a weapon selection system for a game ill be working on sooon and have got a bit stuck while writing the menus

Heres the code of one on the weapons



basically im wondering if there was some sort function or for loop to do this for around another 10 weapons without doing 400 lines just to selected the variables to get the weapons

also im open to comments about my code and other suggestions on how to improve it even if it doesnt do it in a loop

thanks in advance
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Jan 2010 13:24
You're asking about arrays - there are tutorials around the forum for those.

And these are rarely useful for complex lists (not just lists of data like integers, etc) without 'types', also which have tutorials around the forum.

Good luck

"everyone forgets a semi-colon sometimes." - Phaelax
Teh Stone
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 27th Jan 2010 16:34
Thanks for that, I will look into it

Login to post a reply

Server time is: 2024-11-24 20:41:32
Your offset time is: 2024-11-24 20:41:32