|
Post by OddChild on Oct 12, 2006 7:20:49 GMT -5
Hi all, sorry to break up the "hot" discussion I have been trying to change my rapidq menu into brutus. Most of the menu was taken from the example. I will change the images etc, in a week or so... I cant figure out what the problem is... I realize that when the person dies, it should not go to system.run lvl1.exe anymore, since that would go back to menu rather than to th ebegining of the game... brutus.pewtersoftware.com/upload/files/lbl1b.b2dThanks, John
|
|
|
Post by Guilect on Oct 12, 2006 7:57:46 GMT -5
In general you might be better off making a few more sub routines rather than doing so much coding in the sub Main() routine.
In your current program structure, after you die, you would like to re-run parts of the sub Main again, but this will not work because calling sub Main will load all the sounds and graphics again causing an error.
If you break out all the different functions into their own routines it might be easier to call just the ones you want when you want. Just like in grammar, make a new paragraph for each new idea.
For example make a separate sub for initializing all the sounds and graphics. Make another routine to check for the player dying, etc.
Then you can call these one at a time or in groups if you need to and will not be stuck having to run them all in the order that they are currently coded in in your sub Main().
So you will end up with a sub Main() that looks more like this:
Sub Main() InitialiseStuff() ShowMenu() MainLoop() CleanUp() End Sub
Then if you want to show the menu again you just call ShowMenu(), you would not have to call sub Main() just to try to show the menu a second time.
And like wise MainLoop() would be a series of calls to other little routines like so:
Sub MainLoop CheckKeys() Updategraphics() CheckforCollision() etc.... End Sub
I don't always program in this style but it does make piecing together a series of routines possible.
|
|
|
Post by OddChild on Oct 12, 2006 11:24:10 GMT -5
hehe that is a good point. ill do that. the quick fix I suppose would just to move all the initializing to the begining...
|
|
|
Post by OddChild on Oct 12, 2006 17:52:26 GMT -5
Cool, got it to work... I will probably put up a demo in a few days. Made quite a few changes... Changes: video, menu, and level 1 are now all together in the same page of code. level 2 now has cops, and cars that can get you arrested or squashed. level 3 now has conversation dialogs with different people level 3 now also has 2 rooms. Menu image redone (peekay - GFX guy) mmm and some other things, that I cannot quite remember.
|
|
|
Post by u9 on Oct 12, 2006 18:03:27 GMT -5
Keep up the good work... Looking forward to seeing the changes. I'll probably have some ideas you could try out.
|
|