Archery



 archery
-------

Here is another game written for the TI-83. Basically, you choose a
speed, and move your arrow left and right to aim at the moving target. Press
the 2nd key to fire at the target. The closer to the center of the target, and
the faster the speed, the more points you will get. Press mode to pause, and
enter to unpause after you have already been paused.
This program is grouped, so make sure you ungroup it after you download it.
Run ARCHERY, which is the main program. The other programs are just sub
programs. Enjoy.

Here's the code for ARCHERY.83p:
prgmARCHERYS
ClrHome
ClrDraw
Menu("TARGET SPEED","SLOW",1,"NORMAL",2,"FAST",3
Lbl 1:1?S:Goto 5:End
Lbl 2:2?S:Goto 5:End
Lbl 3:3?S:Goto 5:End
Lbl 5
26?D
0?P
Lbl 10
Line(?10,?7.7,10,?7.7
Line(?1,?10,?1,?7.7
randInt(10,82?T
15?X
0?I
50?A
45?B
For(Z,60,0,?1)
getKey??
Text(56,1,"SCORE: ",P
If D<1
Goto 15
Text(56,50,"TIME: ",X,"   "
prgmARCHERYT
prgmARCHERYA
If Z/4=int(Z/4
X-1?X
If ?=22
Pause
If ?=26 and B<85
B+2?B
If ?=24 and B>6
B-2?B
If ?=21
prgmARCHERYF
If I=1
Goto 10
End
D-5?D
15?X
ClrDraw
Goto 10
End

Lbl 15
Line(7,9,7,?5.1
Line(9,9,9,?5.1
Line(7,9,9,9
Line(7,?5.1,9,?5.1
If P?7
"TRY AGAIN"?Str2
If P>7 and P?13:Then
"OK"?Str2
8?C
End
If P>13 and P?19:Then
"NOT BAD"?Str2
6?C
End
If P>19 and P?22:Then
"GOOD"?Str2
?3?C
End
If P>22 and P?30:Then
"GREAT"?Str2
0?C
End
If P>30:Then
"AWESOME"?Str2
1.5?C
End
If P?7:Then
Line(0,0,0,2
Line(0,0,?1.5,.5
Line(2.5,?7.5,0,0:Goto 6
Else
Line(7,C,1,C)
Line(1,C,0,C-.75
Line(1,C,0,C+.75
Lbl 6
Text(56,50,Str2
Pause
prgmAXIS

prgmARCHERYA.83p:
Pxl-Off(A-1,B-2
Pxl-Off(A,B-2
Pxl-Off(A+1,B-2
Pxl-Off(A+2,B-2
Pxl-Off(A-1,B+2
Pxl-Off(A,B+2
Pxl-Off(A+1,B+2
Pxl-Off(A+2,B+2
Pxl-On(A-1,B
Pxl-On(A,B
Pxl-On(A+1,B
Pxl-On(A+2,B
Return

prgmARCHERYF.83p:
For(Q,A-2,3,?3)
Text(56,50,"FIRING   "
prgmARCHERYT
Pxl-Off(Q+3,B
Pxl-Off(Q+4,B
Pxl-Off(Q+5,B
If pxl-Test(Q-2,B)=1 or pxl-Test(Q,B)=1 or pxl-Test(Q-1,B)=1
Goto X
Pxl-On(Q-1,B
Pxl-On(Q,B
Pxl-On(Q+1,B
Pxl-On(Q+2,B
End
Text(56,50,"MISS           "
For(Z,1,25)
End
1?I
D-5?D
?S?S
ClrDraw
Return
Lbl X
Text(56,50,"HIT!             "
Pxl-On(Q-1,B
Pxl-On(Q,B
Pxl-On(Q+1,B
Pxl-On(Q+2,B
If B=T+3 or B=T-3
P+abs(1S)?P
If B=T+2 or B=T-2
P+abs(2S)?P
If B=T+1 or B=T-1
P+abs(3S)?P
If B=T:Then
P+abs(5S)?P
Text(56,50,"BULL^S EYE!!! "
Pause
End
For(Z,1,45
End
1?I
ClrDraw
D-5?D
?S?S
Return

prgmARCHERYS.83p:
FnOff
ClrDraw
AxesOff
ZStandard
Text(7,48,"ARCHERY"
DrawF ?(?40X)
Text(15,59,"BY:
DrawF ??(?40X)
30?D
4?E
?2.5?A
9.6?B
For(C,?3,?8,?1)
Text(28,D,")
Line(A,B,C,0)
Line(A,?B,C,0)
D-E?D
For(G,1,20
End
End
Line(A,B,A,?B)
Line(C,0,10,0)
Text(15,59,"BY: J?FF F."
Text(40,50,"2nd F?res"
Text(48,50,"MODE Pause s"
Pause
Return

prgmARCHERYT.83p:
T+S?T
If T<9 or T>85
?S?S
If S>0:Then
Pxl-Off(D,T-4
Pxl-Off(D,T-5
Pxl-Off(D,T-6
End
If S<0:Then
Pxl-Off(D,T+4
Pxl-Off(D,T+5
Pxl-Off(D,T+6
End
Pxl-On(D,T-3
Pxl-On(D,T-2
Pxl-On(D,T-1
Pxl-On(D,T
Pxl-On(D,T+1
Pxl-On(D,T+2
Pxl-On(D,T+3
Return

© 1997 bckcoats@ix.netcom.com


This page hosted by GeoCities Get your own Free Home Page


1