Add to Favorites    Make Home Page 332980 Online  
 Language Categories  
 Our Services  

Home » Pascal Home » Pascal Projects Home » Space Fighting Game in Pascal.

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Space Fighting Game in Pascal.
Description
Category Pascal » Pascal Projects
Hits 378685
Code Select and Copy the Code
{ Description: space fighting game } program game; uses crt; var x,y,position,a,b,d,enemy,bullet,n,life:integer; c:char; wrd:array[1..14] of char; procedure data; begin clrscr; textmode(co80); for n:=1 to 1000 do begin a:=random(80); b:=random(25); d:=random(13); textcolor(d); gotoxy(a,b); writeln('.'); end; gotoxy(1,8); textcolor(14); Writeln('The year is 4090 A.D ......':54);delay(500); writeln('The Dark Force from planet Xoro has wreaked havoc in the universe......':77);delay(500); writeln('You''r mission is to command the Rebel forces and Save the universe...':77);delay(500); writeln('You fly an Apache equipped with caesium lasers ....':63);delay(500); writeln('the most powerful weapon in the universe ...':57);delay(500); writeln('You are the only person that stands between the Dark Force and...':71); writeln('the rest of the Universe....':52); gotoxy(27,20); textcolor(11); writeln('Get ready for take off'); delay(1200); for n:=100 to 900 do begin sound(n); delay(10); nosound; end; end; procedure start; begin clrscr; textmode(co40); textcolor(4); gotoxy(14,12); delay(900); for n:=1 to 12 do begin write(wrd[n]); delay(50); sound(300); delay(100); nosound; end; delay(1000); textmode(co80); textcolor(11); gotoxy(20,10); writeln('Hit enter to start the game'); gotoxy(20,11); writeln('Hit space for help'); c:=readkey; if c=#13 then data; if c=#32 then begin textmode(co80); textcolor(4); gotoxy(20,10); writeln('To quit from the game press Esc'); gotoxy(20,11); writeln('To pause the game press P'); gotoxy(20,12); textcolor(11); writeln('To move your ship right press ', #26 ); gotoxy(20,13); textcolor(11); writeln('To move your ship left press ',#27); gotoxy(20,14); textcolor(4); writeln('To shoot press Z'); gotoxy(20,20); delay(1000); textcolor(20); writeln('SO SAY YOUR PRAYERS AND HIT ENTER'); readln; data; end; end; procedure hit; begin gotoxy(10,2); writeln('Take that..Heee...Heee':20); delay(550); randomize; repeat n:=random(80); x:=n; y:=1; until (n>=25) and (n<=55) ; enemy:=enemy-1; sound(500); delay(20); nosound; sound(550); delay(20); nosound; sound(600); delay(20); nosound; end; procedure dead; begin sound(1000); delay(400); nosound; textmode(co40); textcolor(9); gotoxy(15,10); writeln('GAME OVER'); delay(1500); readkey; end; procedure win; begin clrscr; textcolor(11); gotoxy(1,10); writeln('Congratulations........':51); writeln('You have saved the Universe from chaos and destruction..':66); writeln('As a reward for your courage and guts the Universe has ':66); writeln('made you its supreme Commander...':55); for n:=1 to 6 do begin sound(1100); delay(100); nosound; sound(1000); delay(80); nosound; sound(900); delay(60); nosound; sound(800); delay(40); nosound; end; readln; end; BEGIN {read the title} wrd[1]:='S';wrd[2]:='A';wrd[3]:='T';wrd[4]:='A';wrd[5]:='N';wrd[6]:='I'; wrd[7]:='C' ;wrd[8]:=' ';wrd[9]:='W';wrd[10]:='A';wrd[11]:='R';wrd[12]:='S'; start; {initialize all the values} x:=40; y:=1; position:=45; enemy:=20; bullet:=0; life:=10; repeat if y>23 then y:=1; clrscr; for n:=1 to 100 do {creates the flickering dots on the screen} begin randomize; a:=random(78); b:=random(25); textcolor(15); gotoxy(a,b); writeln('.'); end; textcolor(11); gotoxy(59,2); writeln('Dark Force=',enemy); gotoxy(59,3); for n:=1 to life do {displays the your status in terms of those little hearts} begin textcolor(4); write(#3); end; textcolor(1);{creates the enemy} gotoxy(x,y); writeln('( )'); gotoxy(x,y+1); textcolor(20); writeln(' o o'); gotoxy(x,y+2); textcolor(11); writeln(' O '); textcolor(14); {creates the gun} gotoxy(position,25); writeln(#15); delay(60); y:=y+1; if keypressed then {check for keyboard input} begin c:=readkey; if c=#27 then halt; if c='p' then readln; if c= 'z' then begin sound(900);delay(30);nosound; if position=(x+2) then hit; end; if c=#0 then begin c:=readkey; if ord(c)=77 then position:=position+1; if ord(c)=75 then position:=position-1; end; end; if y=23 then life:=life-1; until (enemy=0) or (life=0); if (enemy=0) and (life>0) then win; if (life=0) then dead; END.

Related Source Codes

Script Name Author
Calendar date to day number and back Nicky McLean
Matrix Multiple Cirruse Salehnasab
Function Power Recursive Cirruse Salehnasab
swim brian colston
tetris (Mini Project) mehdi farrokhzad
Macsi - space fighting game. Macsi PÚter
Recursive Monkey Puzzle Solution - Project Maxim C.L. Wrne
Maze Game Project In Pascal Mahmood
Excellent Rat in a Maze Program. VyomWorld
A car game. You have to drive the car in such a way that you dont strike a barrier on the road. VyomWorld
Student Database Information System. VyomWorld
Tic Tac Toe Game implemented in Pascal. VyomWorld
Game to Gain more blocks by drawing appropriate lines from correct places(dots). VyomWorld
To Find The Coinage Of The Amount Entered. VyomWorld
Randomizes two 3x3 arrays and indicates the numbers whih are common in both the arrays otherwise an cross 'x' is shown instead. VyomWorld

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=163


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review