home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / games / pulsar_source.amos / pulsar_source.amosSourceCode < prev   
AMOS Source Code  |  1991-08-16  |  13KB  |  330 lines

  1. ' *********************************************************
  2. ' *                                                       *
  3. ' *                         PULSAR                        *
  4. ' *                                                       *
  5. ' *              By Electronic Illusions 1992             *
  6. ' *                                                       *
  7. ' *                                                       *
  8. ' *  Programming : THE GREEN PIMPERNEL   Graphics : J.J   *
  9. ' *                     Music : BECKY                     *
  10. ' *                                                       *
  11. ' * Here's the source! Feel free to chop 'n' change, but  *
  12. ' * please credit anything you nick to us. Thanks.        *
  13. ' *                                                       *
  14. ' * P.S. If your disk is in drive df1:, you will need to  *
  15. ' *   type 'DIR$="DF1:"' on direct mode. Do this for      *
  16. ' *          whatever drive the disk is in.               *
  17. ' *                                                       *
  18. ' *********************************************************
  19. NM=107
  20. Dim TX$(NM)
  21. TX$(1)="Press fire to start"
  22. TX$(4)="Credits:"
  23. TX$(6)="Programming: THE GREEN PIMPERNEL"
  24. TX$(7)="    Graphix: J.J                "
  25. TX$(8)="      Music: BECKY              "
  26. TX$(10)="Greets go out to the following:"
  27. TX$(12)="Tim"
  28. TX$(13)="Jon"
  29. TX$(14)="Ian"
  30. TX$(15)="Dusty"
  31. TX$(16)="Zat"
  32. TX$(17)="The goldfish"
  33. TX$(18)="And"
  34. TX$(19)="The little dragon type thing on J.J's"
  35. TX$(20)="'Utopia' poster."
  36. TX$(21)="+--------------+"
  37. TX$(22)="|The Storyline:|"
  38. TX$(23)="+--------------+"
  39. TX$(25)="Well there isn't one!!!!!!!!!"
  40. TX$(28)="The Idea:"
  41. TX$(31)="Blast hell out of the other player!!!"
  42. TX$(34)="See doc files for further info."
  43. TX$(36)="There now follows a load of rubbish,"
  44. TX$(37)="courtesy of"
  45. TX$(38)="THE GREEN PIMPERNEL"
  46. TX$(40)="I hate Amiga computers."
  47. TX$(42)="Mainly 'cos when I did this the extra"
  48. TX$(43)="disk drives started refusing to read"
  49. TX$(44)="all my disks."
  50. TX$(46)="Correction:"
  51. TX$(49)="I hate disk drives on Amiga computers."
  52. TX$(51)="But I hate Atari STs even more!!"
  53. TX$(52)="Who yer gonna call??"
  54. TX$(53)="ST Busters!!"
  55. TX$(54)="At the time of writing(2.27pm 27-3-1992)"
  56. TX$(55)="I am sitting at J.J's computer writing a"
  57. TX$(56)="load of garbage for a pretty awful game."
  58. TX$(58)="It's this weird game called PULSAR."
  59. TX$(60)="It's also the first thing that"
  60. TX$(61)="+++ ELECTRONIC ILLUSIONS +++"
  61. TX$(62)="ever wrote..."
  62. TX$(64)="Need I say more??"
  63. TX$(66)="It's blimmin' cold, the wind's blowing,"
  64. TX$(67)="it tried to snow yesterday, I can't"
  65. TX$(68)="seem to get my fingers round these keys!"
  66. TX$(70)="ARRRRRGH!!"
  67. TX$(72)="Ha Ha its my turn!"
  68. TX$(75)="SOUTHAMPTON F.C are the BEST"
  69. TX$(78)="J.J is here......."
  70. TX$(81)="I'm very happy at the moment"
  71. TX$(82)="I'm getting rid of Tim for the weekend!"
  72. TX$(83)="Don't complain about the graphics"
  73. TX$(85)="Or something bad might happen?"
  74. TX$(88)="And we wouldn't want that"
  75. TX$(90)="I hope you didn't read to much of TGP's"
  76. TX$(91)="text"
  77. TX$(92)="(Thanks, J.J - T.G.P.)"
  78. TX$(93)="Thats ok G.P,any time"
  79. TX$(97)="I'm not going to go on much longer"
  80. TX$(99)="I'll just tell you that our next game"
  81. TX$(100)="might be a racing game."
  82. TX$(101)="I will just have to threaten G.P a bit"
  83. TX$(103)="Thats it I won't keep you from playing"
  84. TX$(104)="the game......"
  85. TX$(106)="SEE YA!"
  86. Close Editor 
  87. W$=""
  88. STRT:
  89. Erase 1
  90. Screen Open 0,320,256,16,Lowres
  91. Hide 
  92. Paper 0
  93. Cls 
  94. Curs Off 
  95. Centre "STILL LOADING!"
  96. Wait Vbl 
  97. Amos To Front 
  98. Load "skilltune.abk"
  99. Mvolume 63
  100. Load Iff "PulsarPic.IFF",0
  101. Paper 0
  102. Music 1
  103. MS:
  104. For S=0 To NM/3
  105.    For S2=0 To 2
  106.       TN=(S*3)+S2
  107.       If TX$(TN)<>"" Then SHTXT[TX$(TN),20-(Len(TX$(TN))/2),S2+13]
  108.    Next S2
  109.    T=Timer+200
  110.    Repeat 
  111.       B=Fire(1)
  112.    Until B=True or Timer>T
  113.    If B=True Then Exit 
  114.    Cls 0,0,101 To 320,130
  115. Next S
  116. If B=False Then Goto MS
  117. Fade 9
  118. For FD=63 To 0 Step -1
  119.    Mvolume FD
  120.    Wait 2
  121. Next FD
  122. Music Off 
  123. Erase 3
  124. Screen Close 0
  125. Load Iff "map.IFF",1
  126. Screen Open 0,320,256,16,Lowres
  127. Screen 0
  128. Paper 0
  129. Cls 
  130. Curs Off 
  131. Flash Off 
  132. Get Icon Palette 
  133. Hide 
  134. Double Buffer 
  135. Autoback 0
  136. Global XPOS1,YPOS1,XPOS2,YPOS2,XRM1,YRM1,XRM2,YRM2,T1,T2,L1,L2,T1S$,T2S$,T1T,T2T
  137. XPOS1=2 : XPOS2=55 : YPOS1=2 : YPOS2=53 : XRP1=2 : XRP2=13 : YRP1=2 : YRP2=5 : XRM1=1 : OXR1=0 : XRM2=4 : OXR2=0 : YRM1=1 : OYR1=0 : YRM2=9 : OYR2=0 : D1=3 : D2=1 : T1=0 : T2=0 : ND1=0 : ND2=0
  138. L1=20 : L2=20 : P1=10 : P2=10 : E1=15 : E2=15 : T1S$="" : T2S$="" : T1T=0 : T2T=0
  139. For DB=1 To 2
  140.    Ink 2,0
  141.    Box 18,15 To 30,117
  142.    Box 269,15 To 281,117
  143.    Box 18,137 To 30,239
  144.    Box 269,137 To 281,239
  145.    Text 11,130,"LIFE"
  146.    Text 264,130,"GUN"
  147.    Ink 4
  148.    Bar 19,16 To 29,116
  149.    Bar 270,16 To 280,116
  150.    Ink 6
  151.    Bar 19,138 To 29,238
  152.    Bar 270,138 To 280,238
  153.    Screen Swap 
  154. Next DB
  155. Ink 2
  156. Timer=0
  157. TST:
  158. Wait Vbl 
  159. Gosub DR
  160. If L1=0 Then Screen 1 : Get Bob 1,78,0 To 225,55 : Screen 0 : Screen Close 1 : No Mask 1 : Paste Bob 76,39,1 : Screen Swap : Paste Bob 76,39,1 : Screen Swap : Wait 200 : Fade 3 : Wait 45 : Goto STRT
  161. If L2=0 Then Screen 1 : Get Bob 2,78,0 To 225,55 : Screen 0 : Screen Close 1 : No Mask 2 : Paste Bob 76,158,2 : Screen Swap : Paste Bob 76,158,2 : Screen Swap : Wait 200 : Fade 3 : Wait 45 : Goto STRT
  162. Screen 1
  163. If Jleft(1)=True Then D1=4 : If(Point(XPOS1-1,YPOS1)=0 or Point(XPOS1-1,YPOS1)>10) and(XPOS1-1<>XPOS2 or YPOS1<>YPOS2) and(ND1=0 or ND1=4) Then XPOS1=XPOS1-1 : XRP1=XRP1-1 : D1=4 : If XRP1=0 Then XRM1=XRM1-1 : XRP1=14
  164. If Jleft(0)=True Then D2=4 : If(Point(XPOS2-1,YPOS2)=0 or Point(XPOS2-1,YPOS2)>10) and(XPOS2-1<>XPOS1 or YPOS2<>YPOS1) and(ND2=0 or ND2=4) Then XPOS2=XPOS2-1 : XRP2=XRP2-1 : D2=4 : If XRP2=0 Then XRM2=XRM2-1 : XRP2=14
  165. If Jright(1)=True Then D1=2 : If(Point(XPOS1+1,YPOS1)=0 or Point(XPOS1+1,YPOS1)>10) and(XPOS1+1<>XPOS2 or YPOS1<>YPOS2) and(ND1=0 or ND1=2) Then XPOS1=XPOS1+1 : XRP1=XRP1+1 : D1=2 : If XRP1=15 Then XRM1=XRM1+1 : XRP1=1
  166. If Jright(0)=True Then D2=2 : If(Point(XPOS2+1,YPOS2)=0 or Point(XPOS2+1,YPOS2)>10) and(XPOS2+1<>XPOS1 or YPOS2<>YPOS1) and(ND2=0 or ND2=2) Then XPOS2=XPOS2+1 : XRP2=XRP2+1 : D2=2 : If XRP2=15 Then XRM2=XRM2+1 : XRP2=1
  167. If Jup(1)=True Then D1=1 : If(Point(XPOS1,YPOS1-1)=0 or Point(XPOS1,YPOS1-1)>10) and(XPOS1<>XPOS2 or YPOS1-1<>YPOS2) and(ND1=0 or ND1=1) Then YPOS1=YPOS1-1 : YRP1=YRP1-1 : D1=1 : If YRP1=0 Then YRM1=YRM1-1 : YRP1=6
  168. If Jup(0)=True Then D2=1 : If(Point(XPOS2,YPOS2-1)=0 or Point(XPOS2,YPOS2-1)>10) and(XPOS2<>XPOS1 or YPOS2-1<>YPOS1) and(ND2=0 or ND2=1) Then YPOS2=YPOS2-1 : YRP2=YRP2-1 : D2=1 : If YRP2=0 Then YRM2=YRM2-1 : YRP2=6
  169. If Jdown(1)=True Then D1=3 : If(Point(XPOS1,YPOS1+1)=0 or Point(XPOS1,YPOS1+1)>10) and(XPOS1<>XPOS2 or YPOS1+1<>YPOS2) and(ND1=0 or ND1=3) Then YPOS1=YPOS1+1 : YRP1=YRP1+1 : D1=3 : If YRP1=7 Then YRM1=YRM1+1 : YRP1=1
  170. If Jdown(0)=True Then D2=3 : If(Point(XPOS2,YPOS2+1)=0 or Point(XPOS2,YPOS2+1)>10) and(XPOS2<>XPOS1 or YPOS2+1<>YPOS1) and(ND2=0 or ND2=3) Then YPOS2=YPOS2+1 : YRP2=YRP2+1 : D2=3 : If YRP2=7 Then YRM2=YRM2+1 : YRP2=1
  171. If Point(XPOS1,YPOS1)=15
  172.    If XPOS1=5 and YPOS1=5 : XPOS1=46 : YPOS1=23 : XRM1=4 : YRM1=4 : XRP1=4 : YRP1=5 : End If 
  173.    If XPOS1=55 and YPOS1=10 : XPOS1=49 : XRP1=7 : End If 
  174.    If XPOS1=15 and YPOS1=20 : XPOS1=39 : YPOS1=50 : XRM1=3 : YRM1=9 : XRP1=11 : YRP1=2 : End If 
  175.    If XPOS1=24 and YPOS1=34 : XPOS1=5 : YPOS1=42 : XRM1=1 : YRM1=7 : XRP1=5 : YRP1=6 : End If 
  176.    If XPOS1=4 and YPOS1=42 : XPOS1=17 : YPOS1=34 : XRM1=2 : YRM1=6 : XRP1=3 : YRP1=4 : End If 
  177.    If XPOS1=54 and YPOS1=46 : XPOS1=6 : YPOS1=17 : XRM1=1 : YRM1=3 : XRP1=6 : YRP1=5 : End If 
  178. End If 
  179. If Point(XPOS2,YPOS2)=15
  180.    If XPOS2=5 and YPOS2=5 : XPOS2=46 : YPOS2=23 : XRM2=4 : YRM2=4 : XRP2=4 : YRP2=5 : End If 
  181.    If XPOS2=55 and YPOS2=10 : XPOS2=49 : XRP2=7 : End If 
  182.    If XPOS2=15 and YPOS2=20 : XPOS2=39 : YPOS2=50 : XRM2=3 : YRM2=9 : XRP2=11 : YRP2=2 : End If 
  183.    If XPOS2=24 and YPOS2=34 : XPOS2=5 : YPOS2=42 : XRM2=1 : YRM2=7 : XRP2=5 : YRP2=6 : End If 
  184.    If XPOS2=4 and YPOS2=42 : XPOS2=17 : YPOS2=34 : XRM2=2 : YRM2=6 : XRP2=3 : YRP2=4 : End If 
  185.    If XPOS2=54 and YPOS2=46 : XPOS2=6 : YPOS2=17 : XRM2=1 : YRM2=3 : XRP2=6 : YRP2=5 : End If 
  186. End If 
  187. ND[XPOS1,YPOS1] : ND1=Param
  188. ND[XPOS2,YPOS2] : ND2=Param
  189. Screen 0
  190. If XPOS1=3 and YPOS1=2 and D1=1 and P1<10 and T1<Timer Then P1=10 : T1=Timer+3000 : Bell : Ink 4 : Bar 270,16 To 280,116 : Screen Swap : Bar 270,16 To 280,116 : Ink 2
  191. If XPOS1=2 and YPOS1=3 and D1=4 and E1>0 and L1<20
  192. If 20-L1>E1 : L1=L1+E1 : E1=0 : Else E1=E1-(20-L1) : L1=20 : End If 
  193.    Bell 
  194.    Ink 4 : Bar 19,((20-L1)*5)+16 To 29,116 : Screen Swap : Bar 19,((20-L1)*5)+16 To 29,116 : Ink 2
  195. End If 
  196. If XPOS2=54 and YPOS2=53 and D2=3 and P2<10 and T2<Timer Then P2=10 : T2=Timer+3000 : Bell : Ink 6 : Bar 270,138 To 280,238 : Screen Swap : Bar 270,138 To 280,238 : Ink 2
  197. If XPOS2=55 and YPOS2=52 and D2=2 and E2>0 and L2<20
  198. If 20-L2>E2 : L2=L2+E2 : E2=0 : Else E2=E2-(20-L2) : L2=20 : End If 
  199.    Bell 
  200.    Ink 6 : Bar 19,((20-L2)*5)+138 To 29,238 : Screen Swap : Bar 19,((20-L2)*5)+138 To 29,238 : Ink 2
  201. End If 
  202. If Fire(1)=True and P1>0 Then SHOT[XPOS1,YPOS1,XRP1,YRP1,XRM1,YRM1,D1] : Add P1,-1 : For DB=1 To 2 : Ink 0 : Bar 270,16 To 280,116 : Ink 4 : If P1>0 : Bar 270,((10-P1)*10)+16 To 280,116 : End If : Screen Swap : Next DB : Ink 2
  203. If Fire(0)=True and P2>0 Then SHOT[XPOS2,YPOS2,XRP2,YRP2,XRM2,YRM2,D2] : Add P2,-1 : For DB=1 To 2 : Ink 0 : Bar 270,138 To 280,238 : Ink 6 : If P2>0 : Bar 270,((10-P2)*10)+138 To 280,238 : End If : Screen Swap : Next DB : Ink 2
  204. Goto TST
  205. End 
  206. DR:
  207. Cls 0,36,18 To 263,236
  208. Text 11,130,"LIFE"
  209. Text 264,130,"GUN"
  210. If OXR1<>XRM1 or OYR1<>YRM1
  211.    OXR1=XRM1 : OYR1=YRM1
  212.    Screen 1
  213.    Cls 0,0,100 To 224,196
  214.    SY=0
  215.    For SHY=(YRM1-1)*6+1 To YRM1*6
  216.       SX=0
  217.       For SHX=(XRM1-1)*14+1 To XRM1*14
  218.          P=Point(SHX,SHY)
  219.          If P>0 : Paste Icon SX*16,(SY*16)+100,P+8 : End If 
  220.          SX=SX+1
  221.       Next SHX
  222.       SY=SY+1
  223.    Next SHY
  224.    Get Bob 1,0,100 To 224,196
  225.    Screen 0
  226. End If 
  227. Paste Bob 38,20,1
  228. Box 36,18 To 263,117
  229. Paste Icon((XRP1-1)*16)+38,((YRP1-1)*16)+20,D1
  230. If XRM2=XRM1 and YRM2=YRM1 Then Paste Icon((XRP2-1)*16)+38,((YRP2-1)*16)+20,D2+4
  231. If OXR2<>XRM2 or OYR2<>YRM2
  232.    OXR2=XRM2 : OYR2=YRM2
  233.    Screen 1
  234.    Cls 0,0,100 To 224,196
  235.    SY=0
  236.    For SHY=(YRM2-1)*6+1 To YRM2*6
  237.       SX=0
  238.       For SHX=(XRM2-1)*14+1 To XRM2*14
  239.          P=Point(SHX,SHY)
  240.          If P>0 : Paste Icon SX*16,(SY*16)+100,P+8 : End If 
  241.          SX=SX+1
  242.       Next SHX
  243.       SY=SY+1
  244.    Next SHY
  245.    Get Bob 2,0,100 To 224,196
  246.    Screen 0
  247. End If 
  248. Paste Bob 38,139,2
  249. Box 36,137 To 263,236
  250. Paste Icon((XRP2-1)*16)+38,((YRP2-1)*16)+139,D2+4
  251. If XRM2=XRM1 and YRM2=YRM1 Then Paste Icon((XRP1-1)*16)+38,((YRP1-1)*16)+139,D1
  252. S$=""
  253. If P1=0 Then S$="Pulse gun drained"
  254. If T1T>Timer Then S$=T1S$
  255. If L1<3 Then Ink 4 : S$="WARNING: Life in danger!"
  256. If L1<2 Then S$="WARNING: Life critical!"
  257. If L1=0 Then S$="*** REST IN PEACE ***"
  258. If S$<>""
  259.    L=Text Length(S$)
  260.    Text 149-L/2,126,S$
  261. End If 
  262. Ink 2
  263. S$=""
  264. If P2=0 Then S$="Pulse gun drained"
  265. If T2T>Timer Then S$=T2S$
  266. If L2<3 Then Ink 4 : S$="WARNING: Life in danger!"
  267. If L2<2 Then S$="WARNING: Life critical!"
  268. If L2=0 Then S$="*** REST IN PEACE ***"
  269. If S$<>""
  270.    L=Text Length(S$)
  271.    Text 149-L/2,134,S$
  272. End If 
  273. Ink 2
  274. Screen Swap 
  275. Return 
  276. Procedure SHOT[XMP,YMP,XP,YP,XR,YR,D]
  277.    SHTSTRT:
  278.    If D=1 Then NX=XMP : NY=YMP-1
  279.    If D=2 Then NX=XMP+1 : NY=YMP
  280.    If D=3 Then NX=XMP : NY=YMP+1
  281.    If D=4 Then NX=XMP-1 : NY=YMP
  282.    E=True
  283.    If NX=XPOS1 and NY=YPOS1 Then Boom : Add L1,-1 : For DB=1 To 2 : Ink 0 : Bar 19,16 To 29,116 : If L1>0 : Ink 4 : Bar 19,((20-L1)*5)+16 To 29,116 : Screen Swap : Next DB : Ink 2 : End If : T1S$="Hit!" : T1T=Timer+25 : Goto SHD
  284.    If NX=XPOS2 and NY=YPOS2 Then Boom : Add L2,-1 : For DB=1 To 2 : Ink 0 : Bar 19,138 To 29,238 : If L2>0 : Ink 6 : Bar 19,((20-L2)*5)+138 To 29,238 : Screen Swap : Next DB : Ink 2 : End If : T2S$="Hit!" : T2T=Timer+25 : Goto SHD
  285.    Screen 1
  286.    If Point(NX,NY)=0 or Point(NX,NY)>10 : XP=XP-(XMP-NX) : YP=YP-(YMP-NY) : XMP=NX : YMP=NY : If XP=0 : XR=XR-1 : XP=14 : End If 
  287.       If XP=15 : XR=XR+1 : XP=1 : End If 
  288.       If YP=0 : YR=YR-1 : YP=6 : End If 
  289.       If YP=7 : YR=YR+1 : YP=1 : End If 
  290.       E=False
  291.    End If 
  292.    SHD:
  293.    Screen 0
  294.    If XR=XRM1 and YR=YRM1
  295.       Ink 2
  296.       Bar(16*(XP-1))+44,(16*(YP-1))+26 To(16*(XP-1))+47,(16*(YP-1))+29
  297.       Screen Swap 
  298.       Bar(16*(XP-1))+44,(16*(YP-1))+26 To(16*(XP-1))+47,(16*(YP-1))+29
  299.       Screen Swap 
  300.    End If 
  301.    If XR=XRM2 and YR=YRM2
  302.       Ink 2
  303.       Bar(16*(XP-1))+44,(16*(YP-1))+145 To(16*(XP-1))+47,(16*(YP-1))+148
  304.       Screen Swap 
  305.       Bar(16*(XP-1))+44,(16*(YP-1))+145 To(16*(XP-1))+47,(16*(YP-1))+148
  306.       Screen Swap 
  307.    End If 
  308.    If E=False Then Goto SHTSTRT
  309. End Proc
  310. Procedure ND[XP,YP]
  311.    P=Point(XP,YP)
  312.    If P<11 or P>14 Then D=0 Else D=P-10
  313. End Proc[D]
  314. Procedure SHTXT[TXT$,X,Y]
  315.    For SH=1 To Len(TXT$)
  316.       Locate X,Y
  317.       T1$=Left$(TXT$,SH-1)
  318.       T2$=Mid$(TXT$,SH,1)
  319.       Pen 1
  320.       Print T1$;
  321.       Pen 2
  322.       Print T2$;
  323.       Pen 3
  324.       Print "*"
  325.       Wait 2
  326.    Next SH
  327.    Pen 1
  328.    Locate X,Y
  329.    Print TXT$+" ";
  330. End Proc