So, I just quick programed this VERY simple RPG but when I start it, the HP's just seem to go by themselves even when I put the players turn on a button system and worst of all the numbers seem to just be random. ignoring the variables and everything. I'm very basic at programing BASIC so please help me all you high level programers. hahah. Please and Thank You! \(^_^)
I'll post the code in the next comment...
Please Help Me Debug this RPG
Root / Programming Questions / [.]
ElzoBroCreated:
Hmm, had a look. Sorry to say but the way you structured the code in general is very strange. I think the biggest problem is you have the flow broken up over several parts with WAIT commands. You can't use buttons with WAIT commands because the program won't read the input.
You would do best to just scrap that and start over with a structure more like this for inputs.
@PATTACK VSYNC 1 B=BUTTON(2) IF B AND #A THEN GOTO @ATTACK GOTO @PATTACKSorry, but if you want a better example I have a simple RPG I've made I could upload it.
Yup, and it can be much longer too just so you know.Does that basically cause a loop that waits for a button input?@PATTACK VSYNC 1 B=BUTTON(2) IF B AND #A THEN GOTO @ATTACK GOTO @PATTACK.
@PATTACK 'UPDATE DISPLAY HERE VSYNC 1 B=BUTTON(2) IF B AND #A THEN GOTO @ATTACK IF B AND #B THEN GOTO @DEFEND GOTO @PATTACK @ATTACK ATT=RND(9)+1 'Random attack 1-10 inclusive. EHP=EHP-ATT GOTO @PATTACK