home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / GAMES / TANYA.ZIP / GAME.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-02-05  |  5.5 KB  |  230 lines

  1. {$A+,B-,D+,L+,N-,E-,O-,R-,S-,V-,G-,F-,I-,X-}
  2. {$M 16384,0,655360}
  3. PROGRAM Tanya;
  4.  
  5. USES ANIVGA,CRT;
  6.  
  7. VAR wherehit,rn,score,i,j,swingtime:Integer;
  8.     ch,prevkey:char;
  9.     hitknee,hitting,Nancydead,Collide:Boolean;
  10.     scstring:String [11];
  11.     whstring:String [11];
  12.  
  13. Procedure Initscreen;
  14. BEGIN
  15.  i:=0;
  16.  j:=3000;
  17.  Nancydead:=FALSE;
  18.  hitting:=FALSE;
  19.  swingtime:=0;
  20.  score:=1000;
  21.  LoadBackgroundPage('title.pic');
  22.  
  23.  Animate;
  24.               FillPage(1-PAGE,Black);
  25.                 FOR i:=1 TO 20000 DO
  26.                  BEGIN
  27.                   PutPixel(Random(Succ(XMAX)),Random(Succ(YMAX)),Random(256))
  28.                  END;
  29.                 i:=0;
  30.                 FadeIn(BACKGNDPAGE,0,Fade_Moiree5);
  31.  
  32. REPEAT
  33. i:=i+1;
  34. DELAY(1);
  35. If keypressed THEN BEGIN Exit; END;
  36. UNTIL (i>5000);
  37. FillBackground(Black);
  38. BackGroundOutTextXY(1,170,'You are Shane Stant, Tanyas hitman. Your mission');
  39. BackGroundOutTextXY(1,176,'is to injure Nancy in the knee as fast as possible');
  40. BackGroundOutTextXY(1,182,'Use the E,S,D,X to move and the L to swing');
  41. BackGroundOutTextXY(10,10,'This is a game I wrote in 2 days after feeling');
  42. BackGroundOutTextXY(10,20,'sick of listening about Tanya Harding. I figured');
  43. BackGroundOutTextXY(10,30,',why not make a Tanya Harding video game?');
  44. BackGroundOutTextXY(10,50,'You need to make sure the CAPS LOCK is on or this');
  45. BackGroundOutTextXY(10,60,'game will not work. The object of the game is');
  46. BackgroundOutTextXY(10,70,'to hit Nancy Kerrigan in the knee without');
  47. BackGroundOutTextXY(10,80,'hitting her anywhere else. If you hit her in');
  48. BackGroundOutTextXY(10,90,'the knee you get 200 bonus points. The longer');
  49. BackGroundOutTextXY(10,100,'you wait the more points you lose.');
  50. BackGroundOutTextXY(10,110,'Press ESC to continue');
  51. BackGroundOutTextXY(50,150,'THE TANYA HARDING GAME v1.0');
  52. BackGroundOutTextXY(50,160,'2/5/94     by Sr. Gomez');
  53. FadeIn(BACKGNDPAGE,0,Fade_ScrollInFromTop);
  54. Animate;
  55. REPEAT
  56. ch:=readkey;
  57. UNTIL (ch=#27);
  58. END;
  59.  
  60. Procedure LoadBG;
  61. BEGIN
  62. ch:=' ';
  63. LoadBackgroundPage('bg.pic');
  64. Animate;
  65. IF loadSprite('nancy.cod',1)=0
  66.   THEN BEGIN
  67.         CloseRoutines;
  68.         WRITELN('Error: '+GetErrorMessage); halt(1)
  69.        END;
  70. IF loadSprite('hitman1.cod',2)=0
  71.   THEN BEGIN
  72.         CloseRoutines;
  73.         WRITELN('Error: '+GetErrorMessage); halt(1)
  74.        END;
  75. IF loadSprite('hitman2.cod',3)=0
  76.   THEN BEGIN
  77.         CloseRoutines;
  78.         WRITELN('Error: '+GetErrorMessage); halt(1)
  79.        END;
  80. IF loadSprite('fall.cod',4)=0
  81.   THEN BEGIN
  82.         CloseRoutines;
  83.         WRITELN('Error: '+GetErrorMessage); halt(1)
  84.        END;
  85.  SpriteN[2]:=2;
  86.  SpriteX[2]:=50; SpriteY[2]:=50;
  87.  SpriteN[1]:=1;
  88.  SpriteX[1]:=150; SpriteY[1]:=100;
  89.  Animate;
  90. END;
  91.  
  92.  
  93. Procedure MoveHitman;
  94. BEGIN
  95. WHILE keypressed DO ch:=readkey;
  96.          If (hitting=FALSE) THEN
  97.          BEGIN
  98.                    If (ch = 'E') or (prevkey = 'E') THEN
  99.                    BEGIN
  100.                         dec(SpriteY[2],2);
  101.                         prevkey:='E';
  102.                    END;
  103.                    If (ch = 'S') or (prevkey = 'S') THEN
  104.                    BEGIN
  105.                         dec(SpriteX[2],2);
  106.                         prevkey:='S';
  107.                    END;
  108.                    If (ch = 'D') or (prevkey = 'D') THEN
  109.                    BEGIN
  110.                         inc(SpriteX[2],2);
  111.                         prevkey:='D';
  112.                    END;
  113.                    If (ch = 'X') or (prevkey = 'X') THEN
  114.                    BEGIN
  115.                         inc(SpriteY[2],2);
  116.                         prevkey:='X';
  117.                    END;
  118.                    if (ch = 'L') THEN
  119.                    BEGIN
  120.                         hitting:=TRUE;
  121.                         SpriteN[2]:=3;
  122.                         Animate;
  123.                         END;
  124.           END;
  125.           if (swingtime<6) and (hitting=TRUE) THEN
  126.           BEGIN
  127.                swingtime:=swingtime+1;
  128.           END;
  129.           if (swingtime=6) THEN
  130.           BEGIN
  131.                swingtime:=0;
  132.                hitting:=FALSE;
  133.                SpriteN[2]:=2;
  134.                ch:=' ';
  135.           END;
  136.     END;
  137.  
  138.  
  139.  
  140. Procedure MoveNancy;
  141. BEGIN
  142. Randomize;
  143. rn:=Random (5);
  144. If (rn=1) THEN
  145. BEGIN
  146.      dec(SpriteX[1],2);
  147.  
  148. END;
  149. If (rn=2) THEN
  150. BEGIN
  151.      dec(SpriteY[1],2);
  152.  
  153. END;
  154.  
  155. If (rn=3) THEN
  156. BEGIN
  157.      inc(SpriteX[1],2);
  158.     
  159. END;
  160.  
  161. If (rn=4) THEN
  162. BEGIN
  163.      inc(SpriteY[1],2);
  164.     
  165.      END;
  166. END;
  167.  
  168.  
  169. Procedure Checkhit;
  170. BEGIN
  171.   collide:=Hitdetect(1,2);
  172.   if collide AND (SpriteN[2]=3) THEN BEGIN
  173.      Nancydead:=TRUE;
  174.      wherehit:=SpriteY[2]-SpriteY[1];
  175.      If (wherehit<26) and (wherehit>17) THEN
  176.      BEGIN
  177.           hitknee:=TRUE;
  178.      END
  179.      ELSE
  180.      BEGIN
  181.           hitknee:=FALSE;
  182.      END;
  183.      Delay(500);
  184.      SpriteN[1]:=4;
  185.      Animate;
  186.      REPEAT
  187.            j:=j-50;
  188.            Sound(j);
  189.            Delay(15);
  190.      UNTIL (j<500);
  191.      NoSound;
  192.     END;
  193.   END;
  194.  
  195.  
  196. Procedure ShowScore;
  197. BEGIN
  198. if (hitknee=TRUE) THEN BEGIN
  199. OutTextXY(5,180,1-PAGE,'GOOD WORK!! You hit Nancy IN THE KNEE! Your score is');
  200. END;
  201. if (hitknee=FALSE) THEN BEGIN
  202. OutTextXY(5,180,1-PAGE,'Sorry. You missed Nancys knee. Your score is');
  203. score:=score-200;
  204. END;
  205. str (score,scstring);
  206. OutTextXY(150,186,1-PAGE,Scstring);
  207. REPEAT
  208. UNTIL Keypressed;
  209. ch:=#27;
  210. END;
  211.  
  212.  
  213.  
  214. BEGIN
  215. Initgraph;
  216. Initscreen;
  217. Delay(200);
  218. LoadBG;
  219. REPEAT
  220. Animate;
  221. MoveHitman;
  222. MoveNancy;
  223. Checkhit;
  224. if (ch=#27) THEN BEGIN CloseRoutines; Exit; END;
  225. Score:=Score-5;
  226. UNTIL (Nancydead=TRUE);
  227. Showscore;
  228. CloseRoutines;
  229. END.
  230.