This is a program I made in an hour or two to test out a few concepts and also to hopefully lead to a grander game, though in reflection this would probably involve a called program for every battle and would definitely involve some reworking of the variables in a more orderly fashion.
Controls and "Story"Edit
Basically, you're a wizard who has been hired by the town to kill a couple of loitering slimes with evil intentions. You just use the arrows and enter key, since it's menu-based.
ClrHome Output(2,1," YOU ARE A WIZARD, AND YOUR JOB IS TO PROTECT THE CITYFROM THE SLIMES.") Pause Lbl 0 50→M 100→H 75→A 75→B 0→S 1→P Lbl 1 ClrHome If H<1:Then Goto DI Else:If A<1 and B<1:Then Goto WI Else Goto 2 End Lbl 2 If A<0:Then 0→A End If B<0:Then 0→B End Output(1,1,"MAGIC") Output(1,7,M) Output(2,1,"HEALTH") Output(2,8,H) Output(3,1,"SLIME ONE") Output(3,11,A) Output(4,1,"SLIME TWO") Output(4,11,B) Output(5,1,"POTIONS") Output(5,9,P) Pause ClrHome Menu("WHO?","SLIME ONE",S1,"SLIME TWO",S2,"SELF",MP) Lbl S1 1→S Goto M Lbl S2 2→S Goto M Lbl MP Menu("USE...","POTION+50",UP,"RETURN",1) Lbl UP If P<1:Then ClrHome Output(4,1," YOU ARE OUT OF POTIONS." Pause Goto 1 Else P-1→P M+50→M Goto 1 End Lbl M Menu("WHAT?","BEAM-20",BE,"DRAGON CLAW-15",DR,"M. MISSILE-10",MI,"STAFF-0",ST) Lbl BE If M<20:Then Goto NM Else:If S=1 A-randInt(30,40)→A End If S=2 B-randInt(35,45)→B End M-20→M Goto TD Lbl DR If M<15:Then Goto NM Else:If S=1:Then A-randInt(25,35)→A End If S=2:Then B-randInt(25,35)→B End M-15→M Goto TD Lbl MI If M<10:Then Goto NM Else:If S=1:Then A-randInt(12,20)→A End If S=2:Then B-randInt(12,20)→B End M-10→M Goto TD Lbl ST If S=1:Then A-randInt(5,8)→A End If S=2:Then B-randInt(5,8)→B End Goto TD Lbl TD 0→S If A>0 H-randInt(7,13)→H If B>0 H-randInt(7,13)→H Goto 1 Lbl NM ClrHome Output(3,1,"YOU DO NOT HAVE ENOUGH MAGIC TO CAST THIS SPELL.") Pause ClrHome Goto M Lbl WI ClrHome Output(3,1," YOU KILLED THE SLIMES! HOORAH! THE CITY IS SAVED!") Pause Goto RE Lbl DI Output(3,1," OH NO! YOU'VE BEEN KILLED, AND THE CITY WILL BE OVERRUN!") Pause Goto RE Lbl RE ClrHome Menu("PLAY AGAIN?","YES",0,"NO",6) Lbl 6 Output(4,5,"GOODBYE") Pause ClrHome Stop
Coding of Note(?)Edit
In my opinion, there are few things up there that should be mentioned specifically. For instance, instead of repeating code within the menus to determine the attack to each slime (i.e. 2 enemies and 4 attacks each leading to 8 menus), I used a variable which tells the enemy which will take damage. This could also be used for things that affect all enemies, like area-of-effect attacks, etc. This ended up saving a lot of space and time, not to mention clutter.