home *** CD-ROM | disk | FTP | other *** search
- {$A+,B-,D+,L+,N-,E-,O-,R-,S-,V-,G-,F-,I-,X-}
- {$M 16384,0,655360}
- PROGRAM Tanya;
-
- USES ANIVGA,CRT;
-
- VAR wherehit,rn,score,i,j,swingtime:Integer;
- ch,prevkey:char;
- hitknee,hitting,Nancydead,Collide:Boolean;
- scstring:String [11];
- whstring:String [11];
-
- Procedure Initscreen;
- BEGIN
- i:=0;
- j:=3000;
- Nancydead:=FALSE;
- hitting:=FALSE;
- swingtime:=0;
- score:=1000;
- LoadBackgroundPage('title.pic');
-
- Animate;
- FillPage(1-PAGE,Black);
- FOR i:=1 TO 20000 DO
- BEGIN
- PutPixel(Random(Succ(XMAX)),Random(Succ(YMAX)),Random(256))
- END;
- i:=0;
- FadeIn(BACKGNDPAGE,0,Fade_Moiree5);
-
- REPEAT
- i:=i+1;
- DELAY(1);
- If keypressed THEN BEGIN Exit; END;
- UNTIL (i>5000);
- FillBackground(Black);
- BackGroundOutTextXY(1,170,'You are Shane Stant, Tanyas hitman. Your mission');
- BackGroundOutTextXY(1,176,'is to injure Nancy in the knee as fast as possible');
- BackGroundOutTextXY(1,182,'Use the E,S,D,X to move and the L to swing');
- BackGroundOutTextXY(10,10,'This is a game I wrote in 2 days after feeling');
- BackGroundOutTextXY(10,20,'sick of listening about Tanya Harding. I figured');
- BackGroundOutTextXY(10,30,',why not make a Tanya Harding video game?');
- BackGroundOutTextXY(10,50,'You need to make sure the CAPS LOCK is on or this');
- BackGroundOutTextXY(10,60,'game will not work. The object of the game is');
- BackgroundOutTextXY(10,70,'to hit Nancy Kerrigan in the knee without');
- BackGroundOutTextXY(10,80,'hitting her anywhere else. If you hit her in');
- BackGroundOutTextXY(10,90,'the knee you get 200 bonus points. The longer');
- BackGroundOutTextXY(10,100,'you wait the more points you lose.');
- BackGroundOutTextXY(10,110,'Press ESC to continue');
- BackGroundOutTextXY(50,150,'THE TANYA HARDING GAME v1.0');
- BackGroundOutTextXY(50,160,'2/5/94 by Sr. Gomez');
- FadeIn(BACKGNDPAGE,0,Fade_ScrollInFromTop);
- Animate;
- REPEAT
- ch:=readkey;
- UNTIL (ch=#27);
- END;
-
- Procedure LoadBG;
- BEGIN
- ch:=' ';
- LoadBackgroundPage('bg.pic');
- Animate;
- IF loadSprite('nancy.cod',1)=0
- THEN BEGIN
- CloseRoutines;
- WRITELN('Error: '+GetErrorMessage); halt(1)
- END;
- IF loadSprite('hitman1.cod',2)=0
- THEN BEGIN
- CloseRoutines;
- WRITELN('Error: '+GetErrorMessage); halt(1)
- END;
- IF loadSprite('hitman2.cod',3)=0
- THEN BEGIN
- CloseRoutines;
- WRITELN('Error: '+GetErrorMessage); halt(1)
- END;
- IF loadSprite('fall.cod',4)=0
- THEN BEGIN
- CloseRoutines;
- WRITELN('Error: '+GetErrorMessage); halt(1)
- END;
- SpriteN[2]:=2;
- SpriteX[2]:=50; SpriteY[2]:=50;
- SpriteN[1]:=1;
- SpriteX[1]:=150; SpriteY[1]:=100;
- Animate;
- END;
-
-
- Procedure MoveHitman;
- BEGIN
- WHILE keypressed DO ch:=readkey;
- If (hitting=FALSE) THEN
- BEGIN
- If (ch = 'E') or (prevkey = 'E') THEN
- BEGIN
- dec(SpriteY[2],2);
- prevkey:='E';
- END;
- If (ch = 'S') or (prevkey = 'S') THEN
- BEGIN
- dec(SpriteX[2],2);
- prevkey:='S';
- END;
- If (ch = 'D') or (prevkey = 'D') THEN
- BEGIN
- inc(SpriteX[2],2);
- prevkey:='D';
- END;
- If (ch = 'X') or (prevkey = 'X') THEN
- BEGIN
- inc(SpriteY[2],2);
- prevkey:='X';
- END;
- if (ch = 'L') THEN
- BEGIN
- hitting:=TRUE;
- SpriteN[2]:=3;
- Animate;
- END;
- END;
- if (swingtime<6) and (hitting=TRUE) THEN
- BEGIN
- swingtime:=swingtime+1;
- END;
- if (swingtime=6) THEN
- BEGIN
- swingtime:=0;
- hitting:=FALSE;
- SpriteN[2]:=2;
- ch:=' ';
- END;
- END;
-
-
-
- Procedure MoveNancy;
- BEGIN
- Randomize;
- rn:=Random (5);
- If (rn=1) THEN
- BEGIN
- dec(SpriteX[1],2);
-
- END;
- If (rn=2) THEN
- BEGIN
- dec(SpriteY[1],2);
-
- END;
-
- If (rn=3) THEN
- BEGIN
- inc(SpriteX[1],2);
-
- END;
-
- If (rn=4) THEN
- BEGIN
- inc(SpriteY[1],2);
-
- END;
- END;
-
-
- Procedure Checkhit;
- BEGIN
- collide:=Hitdetect(1,2);
- if collide AND (SpriteN[2]=3) THEN BEGIN
- Nancydead:=TRUE;
- wherehit:=SpriteY[2]-SpriteY[1];
- If (wherehit<26) and (wherehit>17) THEN
- BEGIN
- hitknee:=TRUE;
- END
- ELSE
- BEGIN
- hitknee:=FALSE;
- END;
- Delay(500);
- SpriteN[1]:=4;
- Animate;
- REPEAT
- j:=j-50;
- Sound(j);
- Delay(15);
- UNTIL (j<500);
- NoSound;
- END;
- END;
-
-
- Procedure ShowScore;
- BEGIN
- if (hitknee=TRUE) THEN BEGIN
- OutTextXY(5,180,1-PAGE,'GOOD WORK!! You hit Nancy IN THE KNEE! Your score is');
- END;
- if (hitknee=FALSE) THEN BEGIN
- OutTextXY(5,180,1-PAGE,'Sorry. You missed Nancys knee. Your score is');
- score:=score-200;
- END;
- str (score,scstring);
- OutTextXY(150,186,1-PAGE,Scstring);
- REPEAT
- UNTIL Keypressed;
- ch:=#27;
- END;
-
-
-
- BEGIN
- Initgraph;
- Initscreen;
- Delay(200);
- LoadBG;
- REPEAT
- Animate;
- MoveHitman;
- MoveNancy;
- Checkhit;
- if (ch=#27) THEN BEGIN CloseRoutines; Exit; END;
- Score:=Score-5;
- UNTIL (Nancydead=TRUE);
- Showscore;
- CloseRoutines;
- END.
-