Post by hartnell on Jan 21, 2007 16:29:10 GMT -5
I would like to categorically state that I am not responsible for porting this code from Tim Hartnell's classic work "Tim Hartnell's Second Giant Book of Computer Games", which also happens to be one of my favorite books, but nevertheless I'm not the one who ported it to B2D. Regardless of any conspiracy theories, I have nothing to do with the code that follows. I did not see it before it appeared in my mailbox from someone calling themselves "The CodeSpanker." I have no idea who this is or why this person would mail me code ported from one of my favorite books. Once again, I had no part in porting this code from MS BASIC to B2D.
Ahem. It's a text parachuting game.
-hartnell
P.S. I deny any part in the porting of this code.
Ahem. It's a text parachuting game.
'controls leftkey / rightkey
dim acc
dim answer
dim at
dim c
dim df
dim f
dim gameOver
dim pad
dim plus
dim sbot 'screen bottom
dim stp 'screen top
dim swde ' screen width
'sub from 110
sub init
'key.Wait
while lcase(answer)<"a" or lcase(answer)>"d"
console.Clear
console.WriteLine ""
console.WriteLine "Select your game:"
console.WriteLine space(6) + "A - Easy"
console.WriteLine space(6) + "B - Moderate"
console.WriteLine space(6) + "C - Difficult"
console.WriteLine space(6) + "D - Incredibly Hard"
console.WriteLine ""
answer = console.ReadLine
wend
df = 1/2
if lcase(answer)="c" then df=1
if lcase(answer)="b" then df=2
if lcase(answer)="a" then df=3
stp = 0 'screen top
randomize
stp=0 ' screen top
sbot = 19 ' screen bottom
swde=40 ' width of screen
swde=swde-3
acc=int(rnd(1)*(swde-4))
pad=int(rnd(1)*(swde-10))
plus=1
end sub
'360
sub displayChute
console.Clear
for c=6 to stbot-stp
console.WriteLine ""
next
console.WriteLine space(acc) + " ^ "
console.WriteLine space(acc) + "^^^"
console.WriteLine space(acc) + " 0 "
console.WriteLine space(acc) + " Y "
if stp<>sbot-4 then
for c=6 to sbot-stp
console.WriteLine ""
next
end if
stp=stp+1
end sub
'520
sub landingStrip
pad=pad+plus
if pad>swde-6 then plus = -1
console.WriteLine space(pad) + "@@@@"
end sub
sub checkDrowned
if acc<pad - 1 or acc>pad+2 then
console.WriteLine space(12) + "SPLOSSSSHHHHHHHHHHHHH!"
console.WriteLine space(13) + "You got soaked!"
p = p - 2
elseif acc=pad+1 or acc = pad then
console.WriteLine space(12) + "Congratulations!!"
console.WriteLine space(13) + "A safe landing!"
p = int(p+10/df)
else
console.WriteLine space(8) + "You made it...by the"
console.WriteLine space(9) + "skin of your teeth."
p = p + 5
end if
at = at + 1
if at=20 or p<0 then death
console.WriteLine space(11) + "You have " + cStr(p)+ " points"
system.Pause(1000)
console.WriteLine ""
console.WriteLine "Press any key to continue."
key.Wait
init
end sub
sub death
console.WriteLine space(13) + "You've Drowned!"
console.WriteLine ""
console.WriteLine space(12) + "You've scored " + cstr(p) + " points"
console.WriteLine space(16) + "In " + cstr(at) + " attempts."
console.WriteLine ""
console.WriteLine "Press any key..."
key.Wait
gameOver = true
end sub
sub getKeys
if stp=sbot-4 then checkDrowned
if key.Pressed(vk_left) then acc=acc-df
if key.Pressed(vk_right) then acc=acc+df
end sub
console.Initialize
key.Initialize
rem cavalier 'chute
f=20
gameOver = false
'gosub 110
init
'main cycle
'gosub 360
do while not gameOver and not key.Pressed(vk_escape)
displayChute
landingStrip
getKeys
system.Pause 200
loop
console.Terminate
key.Terminate
-hartnell
P.S. I deny any part in the porting of this code.