home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd553
/
zest_v0.01a.amos
/
zest_v0.01a.amosSourceCode
< prev
Wrap
AMOS Source Code
|
1992-02-09
|
5KB
|
219 lines
' ______
' / ______ ____ _______
' / \ \ \ Written by
' / \___ \___ \ v0.01a Andrew Welsh
' / \ \ \
' \______ \_____ ____\ \
'
' This is a primitive questions and answers game that i started the beginning
' of 1991, it was going to be HUGE with different modules, flashy graphics etc
' but the guy doing the graphics decided he was TOO GOOD for a crappy game
' or anything, so i lost interest, gained interest, then lost it again ..
' so here is the unfinished version, bad code, no remarks (sorry !?!)
'
' I may finish this at a later date, but I hope someone develops it further
'
SEUP
Procedure CLD
Move Off
Set Rainbow 0,1,100,"","",""
Fade 5
Wait 100
Screen Hide 4
Screen Close 4
SEUP
' Restore
End
End Proc
Procedure SEUP
Change Mouse 4
Cls 0
Screen Open 1,640,256,4,Hires
Curs Off : Cls 0 : Flash Off
Screen Open 0,640,256,4,Hires
Curs Off : Cls 0 : Flash Off
Dual Playfield 0,1
Screen 1
Music 1
Get Sprite Palette
Curs Off : Cls 0 : Flash Off
Paper 0 : Pen 1
Print : Print : Centre " ZEST - A Game of Questions and Answers "
GFX
Under On
Locate 1,4 : Print "Question:"
Locate 1,14 : Print "Answer:"
Locate 64,8 : Print "Right:"
Locate 64,13 : Print "Wrong:"
Under Off
'Screen Show 1
Screen 0
Paper 0
SET_MENU
On Menu Proc CHOI,HEP
Menu On
MAIN
End Proc
Procedure GFX
Draw 0,13 To 0,25
Draw 639,13 To 639,25
Draw 0,13 To 639,13
Draw 0,25 To 639,25
Draw 0,30 To 639,30
Draw 0,30 To 0,200
Draw 639,30 To 639,200
Draw 0,200 To 639,200
Draw 500,30 To 500,200
Bar 20,45 To 485,100 :
Bar 20,125 To 485,180 :
Bar 515,75 To 625,92 :
Bar 515,115 To 625,132 :
End Proc
Procedure MAIN
On Menu On
Do
X$=Inkey$
If X$="q"
Edit
End If
Loop
End Proc
Procedure CHOI
If Choice(2)=1 Then MAIN_LOOP
If Choice(2)=2 Then MAIN
If Choice(2)=7 Then Edit
If Choice(2)=6 Then Goto AB
AB:
Curs Off : Screen 0 : Pen 2
Bar 215,20 To 415,100
Home : Pen 1 : Paper 2
Cdown : Cdown : Cdown
Centre " ZEST v0.1a" : Cdown
Centre "------------" : Cdown
Centre "Written By" : Cdown : Cdown
Centre "Andrew Welsh" : Cdown : Cdown
Centre "(C)1991, 1992" : Cdown
Centre "Def Pixel" : Cdown
Centre "Software" : Cdown
Do
If Mouse Key=1
Exit
End If
Loop
Cls 0
MAIN
End Proc
Procedure HEP
If Choice(2)=1 Then Music Off
If Choice(2)=2 Then Music 1
MAIN
End Proc
Procedure SET_MENU
Rem Menu 1
Menu$(1)=" File "
Menu$(1,1)="(Ink 1,1)(SStyle 4) Start (SStyle 0)"
Menu$(1,6)="(Ink 1,1) About "
Menu$(1,7)=" Quit "
Rem Menu 2
Menu$(2)=" Music "
Menu$(2,1)=" Music Off "
Menu$(2,2)=" Music On "
Rem Menu 3
Menu$(3)=" Credits "
Menu$(3,1)=" Written by "
Menu$(3,1,1)=" " : Menu Inactive(3,1,1)
Menu$(3,1,2)=" Andrew Welsh " : Menu Inactive(3,1,2)
Menu$(3,1,3)=" " : Menu Inactive(3,1,3)
End Proc
Procedure MAIN_LOOP
Home : Cls 0 : Menu Off : Paper 0 : Pen 2 : Locate 5,24 : Boom
Print " Are You Ready ? (Y/N) "
Do
X$=Inkey$
If(X$="y") or(X$="Y")
Goto YEP
End If
If(X$="n") or(X$="N")
Goto NOP
End If
Loop
YEP:
Global AN$,ANS$
Open Random 1,"empty:theone"
Field 1,100 As QUEST$,50 As ANS$
Randomize Timer
Cls 0
Do
J:
N=Rnd(50)+Rnd(50)
N=N/2
If N=0 Then Goto J
Get 1,N
Locate 3,6
Print QUEST$
Locate 3,16
AN$=""
Input "Your Answer : ";AN$
AN$=Lower$(AN$)
Repeat
I=Len(AN$)
If I=50
Exit
End If
If I<50
AN$=AN$+" "
End If
Until I=51
If AN$="q "
Goto NOP1
End If
If AN$=ANS$
Gosub RGT
End If
If AN$<>ANS$
Gosub WRG
End If
Loop
WRG:
WS=WS+1
If WS=5
Locate 3,18 : Print " Sorry 5 Questions Wrong ! " : Wait 100 : Goto NOP1
End If
Locate 65,15
Print WS
Cls 0
Locate 65,15 : Print WS
Locate 65,10 : Print SC
Return
'
' Sub-Rout. for if the answer is right
'
RGT:
Curs Off
Locate 3,18
Print " Good Work ... "
SC=SC+1
Locate 65,10
Print SC
Wait 50
Cls 0
Locate 65,10
Print SC
Locate 65,15 : Print WS
Return
' reads the first question.... and goes into a
' loop until they get 5 questions wrong......
' questions randomly selected
'
' Jumps here if n pressed before quest. begin
'
NOP1:
Close 1
Cls 0
Menu On
MAIN
NOP:
Cls 0
Menu On
MAIN
End Proc