Here it is, this was a text baseball game I've been working on but now I've kind of lost inspiration on it and its been sitting in my projects folder for a while now. So I hope someone gets something out of this code, enjoy it guys.
sync on:cls
sync rate 30
hide mouse
rem The recreation of text baseball
rem Recreated June 01, 2007 at 11:37 am.
rem for those who don't know, i had over 200 lines done and i accidently saved over it so i'm restarting it.
rem Thank you Latch,Indi,Link,and LBFN for all your help guys. I'm going to pursue this project seriously
rem I'm a fan of baseball and want to make it a lot of fun.
intro_screen:
backdrop on
load bitmap "C:\Documents and Settings\Compaq_Owner\My Documents\My Pictures\Ian's Stuff\Cd skins\Baseball Menu.bmp",1
texture backdrop 1
wait 5000
gosub main
return
dim action$(4)
dim actiondata$(4)
rem my variables
outs=0
score=0
menonbase=0
homeruns=0
strikes=0
balls=0
rem reading the arrays into the program
For x= 1 to 4
Read action$(x)
next x
For x=1 to 4
Read actiondata$(x)
next x
main:
rem the screen you'll see for now until much later and is upadated.
Text 0,0,"Choose an action:"
Text 0,20,"1.Swing"
Text 0,40,"2.Bunt"
Text 0,60,"3.Wait"
Text 0,80,"4.Taunt"
set cursor 0,100
input "__";choice
Text 0,140,"Choice "+str$(choice)+" Results in a "+action$(choice)
rem subroutines for main base
If action$="1" then gosub options_1
If action$="3" then gosub options_paitent
If action$="4" then gosub taunt_1
cls
rem ----------------------------------------------------------------------------------------------------------------
options_1:
randomize timer()
a=rnd(8)+1
if a=1 then Print "You pop it up to the shorstop who promptly catches it for an out."
if a=2 then Print "You send a roaring line drive past the secondbaseman into center field."
if a=3 then Print "Oh baby that's a rocket!! Its going...going...going..SEE...YOU...LATER!!!!!"
if a=4 then Print "A nice hard hit down the right field line and you round the bases for a big hit."
if a=5 then Print "You knock a hit inbewtween the secondbaseman and the first. That's a base hit."
if a=6 then Print "You send a hard but short shot to the pitcher, he calmly tosses it to the firstbaseman."
if a=7 then Print "Wow, big swing and a miss there and that'll be a strike."
if a=8 then Print "A high flyer, its looking good, oh no! The outfielder catches it for an out."
if a=9 then Print "You send a short shot to the thirdbaseman who quickly throw to first for an out."
wait 5000
if a=6 then inc outs
if a=1 then inc outs
if a=8 then inc outs
if a=9 then inc outs
print "outs=";outs
if a=3 then inc homeruns
if a=3 then menonbase=0
print "homeruns=";homeruns
if a=2 then inc menonbase
if a=4 then inc menonbase
if a=5 then inc menonbase
print "men on=";menonbase
If outs=3 then print "get ready to switch sides."
wait 1000
If outs=3 then gosub options_2
cls
If outs= 3 then dec outs,3
cls
wait 4000
cls
gosub main
return
rem _____________________________________________________________________________________________________________________
options_2:
cls
dim pitching$(4)
dim pitchingdata$(4)
For n= 1 to 4
Read pitching$(n)
next n
For n=1 to 4
Read pitchingdata$(n)
next n
Text 0,0,"Choose an action:"
Text 0,20,"1.Fastball"
Text 0,40,"2.Slider"
Text 0,60,"3.Changeup"
Text 0,80,"4.Breaking Ball"
set cursor 0,100
input "__";choice
Text 0,140,"The pitch is up and its "+str$(choice)+" " +action$(choice)
Select choice
case 1
gosub pitch_one
endcase
case 2
gosub pitch_two
endcase
case 3
gosub pitch_three
endcase
case 4
gosub pitch_four
endcase
Endselect
gosub options_2
return
pitch_one:
randomize timer()
b=rnd(3)+1
if b=1 then print "outside corner"
wait 2000
if b=2 then print "inside"
wait 2000
if b=3 then print "down the middle"
wait 2000
if b=4 then print "wild pitch!"
wait 2000
cls
gosub options_2
return
pitch_two:
randomize timer()
c=rnd(2)+1
if c=1 then print "slides out"
if c=2 then print "slides down"
if c=3 then print "slides left"
cls
gosub options_2
return
pitch_three:
randomize timer()
d=rnd(2)+1
if d=1 then print "goes up then down"
if d=2 then print "spins in a circle"
if d=3 then print "straight down"
cls
gosub options_2
return
pitch_four:
randomize timer()
e=rnd(2)+1
if e=1 then print "Breaks away to the left"
if e=2 then print "Breaks away from the right"
if e=3 then print "Breaks on the inside corner"
cls
gosub options_2
return
rem pitching menu and subrotuines
rem _______________________________________________________________________________________________________________
options_paitent:
randomize timer()
g=rnd(2)+1
if g=1 then inc balls
if g=1 then print "you wait and the ball slides under your knees for a ball."
print "balls=";balls
if g=2 then inc strikes
if g=2 then print "Low and inside, but just makes the strike zone."
print "strikes=";strikes
if g=3 then inc balls
if g=3 then print "WHOA! wild pitch there. The ball sails over you're head."
if balls=4 then print "take your base."
wait 2000
if balls=4 then dec balls,0
if strikes=3 then inc outs
wait 4000
gosub main
taunt_1:
randomize timer()
h=rnd(3)+1
if h=1 then print "You flip your bat in the air and catch it behind your back."
if h=2 then print "As you walk up to the plate, you give a little kiss to the pitcher."
if h=3 then print "You knock dirt off your cleats and point the bat to dead center."
if h=4 then print "You step in the box and do the monkey before doing a cane strut with the bat."
wait 4000
gosub main
