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 / [LOCKED] Shop Menu.. too long... plz help

Author
Message
Saikoro
20
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 7th Oct 2003 02:42
Hi. Im a newb programmer, and I decided to make a 2d rpg game. This weekend I wrote out my code(which btw is not complete) and it works good for what I have. However, the code is a bit lengthy for what it does. If anyone knows how I can shorten it, I appreciate it. Also, the money system in this does not work right, anyone know why? Here is my code:



Just so you know, the sell and upgrade menus do not work yet. Any help would be appreciated-thx

*When I'm depressed, I eat ChocoTacos*
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Oct 2003 04:31 Edited at: 7th Oct 2003 04:32
Wow, thats long. Well, you could use DATA commands to read in your long list of variable values. That could shave off a few lines.

Oh, and this is the code snippets forum. Want help with code, post in the other catagory.
Kharnor
20
Years of Service
User Offline
Joined: 5th Jul 2003
Location: Australia
Posted: 7th Oct 2003 08:11
I only had a quick glance over it, but from the looks of it you're doing identical tasks over and over, just with a few differences. Use functions, gosubs or even "for..next" and your code will dramatically reduce in size.

Current project:
Adventure game for alienware comp (-5% complete: Yep, still going backwards)
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Oct 2003 15:10
This forum is *not* for questions ... you should probably ask for help in the newcomers forum

Login to post a reply

Server time is: 2024-05-03 06:32:54
Your offset time is: 2024-05-03 06:32:54