Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with minigames game
#1
I need help with a little project of mine.
I am making a game which runs many minigames randomly.
I have a problem on the title screen, the first time you run it it works fine, but when you lose at the bouncer game, and return to the title screen, the Only the escape button works, not the other buttons.
(I have it saying press anykey to continue and the escape button is there to shut the game down at any time)

Here is the link to where you can download it

http://www.freewebs.com/qbasicguysarchive/Minigame.bas
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#2
First up, only ever use SLEEP for debugging purposes. That's a law, and not up for debate :wink: .

Replace it with either another waitkey loop, or a time delay in the vein of

T! = timer:While T!+1>timer :wend

secondly, when using random numbers, stick the Command RANDOMIZE TIMER at the start, this has the effect of a different list of numbers being used for random numbers every time you play the game (kind of).

Third, when returning to the mini sub from each game, don't call it again, this will cause the stack to overflow, replace it with EXIT SUB, which acts in the same way as RETURN does for GOSUB.

The bug was caused by this. Instead of going EXIT SUB in bounce, you call TITLESCREEN again, which causes some kind of loopy f u c k up that ment you could only press escape.

To Recap:

To avoid bugs use the EXIT SUB command to return to whence the sub was called, instead of calling the parent sub again.

Matt - needlessly patronising

PS: Boing is nicely entertaining and fun, but you've got to be able to move more then one pixel to play wallbouncer!
o not mistake Apathy for Feeling content...

http://www.disjointed.cjb.net - Short Stories
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
Reply
#3
Thanks, i will try and fix it.


ADDED

I have changed walll bouncer so you have to try and dodge 4 pixels bouncing around the screen.
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#4
ehh, I actually ment the other game, but never mind Big Grin
o not mistake Apathy for Feeling content...

http://www.disjointed.cjb.net - Short Stories
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)