RSS    

   Ðåôåðàò: Ñîçäàíèå èãðû

        s3:=imagesize(0,0,50,20);

        getmem(p3,s3);

        NLO;

        getimage(0,0,50,20,p3^);  putimage(0,0,pp^,copyput);

        zemlya;

        x:=200;y:=379;putimage(x,y,p^,copyput);

        v:=0;b:=0;delay(45000);delay(45000);

      repeat        {Íà÷àëî ñàìîãî ïðîöåññà èãðû}

              for n:=1 to 1770 do begin

              putimage(round(n/3),60,p3^,copyput);

              if n>1760 then begin

                               putimage(round(n/3),60,pp^,copyput);

                               sound(300);delay(100);nosound;

                             end;

              key:=keypressed;

              if key=false then goto 2;

              a:=readkey;

                  if a=chr(77) then begin

                                     x:=x+3;

                                     if x>580 then begin

                                                    putimage(x,y,pp^,copyput);

                                                    x:=10;

                                                   end;

                                     putimage(x,y,p^,copyput);

                                     end;

                  if a=chr(75) then begin

                                     x:=x-3;

                                     if x<10 then begin

                                                     putimage(x,y,pp^,copyput);

                                                     x:=580;

                                                  end;

                                     putimage(x,y,p^,copyput);

                                    end;

                  if a=chr(32) then begin for m:=y-2 downto 56 do begin

                                                        putimage(x+8,m,p1^,copyput);

                                                        delay(5);

                                                                  end;

                                                        if m<90 then

                                                        if round(n/3)>(x-50) then

                                                        if round(n/3)<(x+10) then begin

                                                        sound(800);delay(2000);

                                                        nosound;putimage(round(n/3),60,pp^,copyput);

                                                        putimage(v,10,p1^,copyput);n:=1;

                                                        v:=v+15;if v>500 then begin gameover(b,v);goto 3;end;end;

                                         putimage(x+8,56,p2^,copyput);

                                    end;

2:                                 end;putimage(b,24,p3^,copyput);b:=b+50;

                                   if b>500 then begin gameover(b,v);goto 3;end;

                            if a=chr(113) then begin

                                  v:=550;gameover(b,v);goto 3;

                                     end;

      until a=chr(27);

  end;

begin{Îñíîâíàÿ ïðîãðàììà}

1:   clrscr;

     gotoxy(30,10);

     write('Ââåäåíèå');

     gotoxy(30,11);

     write('Ïîñòàíîâêà çàäà÷è');

     gotoxy(30,12);

     write('Ìàòåìàòè÷åñêèå ìåòîäû...');

     gotoxy(30,13);

     write('Îïèñàíèå äàííûõ');

     gotoxy(30,14);

     write('Àëãîðèòìû è áëîê-ñõåìû');

     gotoxy(30,15);

     write('ÏÐÎÃÐÀÌÌÀ');

     gotoxy(30,16);

     write('Òåêñòîâûå ïðèìåðû');

     gotoxy(30,17);

     write('Ðóêîâîäñòâî ïîëüçîâàòåëþ');

     gotoxy(30,18);

     write('Çàêëþ÷åíèå');

     gotoxy(30,19);

     write('Ñïèñîê ëèòåðàòóðû');{Ýòî âñ¸ ìåíþøêà}

     gotoxy(26,10);

     write('>>>');

     gotoxy(25,10);

     repeat

           a:=readkey;

           if a=chr(80) then begin{äâèæåíèå êóðñîðà âíèç}

                                   b:=wherey;

                                   gotoxy(26,b);

                                   write('   ');

                                   if b>=19 then b:=9;

                                   gotoxy(26,b+1);

                                   write('>>>');

                                   gotoxy(25,b+1);

                                   sound(3000);

                                   delay(1000);

                                   nosound;

                              end;

           if a=chr(72) then begin{äâèæåíèå êóðñîðà ââåðõ}

                                   b:=wherey;

                                   gotoxy(26,b);

                                   write('   ');

                                   if b<=10 then b:=20;

                                   gotoxy(26,b-1);

                                   write('>>>');

                                   gotoxy(25,b-1);

                                   sound(4000);

                                   delay(1000);

                                   nosound;

                              end;

           if a=chr(13) then begin {Îïðîñ êëàâèøè ENTER}

                              b:=wherey;

                              if b=19 then begin  {Ñïèñîê ëèòåðàòóðû}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Êíèæêà ïî Òóðáî-Ïàñêàëþ');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                              if b=10 then begin {Ââåäåíèå}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                               writeln('Îñíîâíîé öåëüþ äàííîãî êóðñîâîãî ïðîåêòà');

                                           gotoxy(30,b+1);

                                writeln('ÿâëÿåòñÿ çàêðåïëåíèå è äåìîíñòðàöèÿ çíàíèé,');

                                           gotoxy(30,b+2);

                                writeln('ïîëó÷åíûõ ïðè èçó÷åíèè êóðñà èíôîðìàòèêè');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                              if b=11 then begin  {Ïîñòàíîâêà çàäà÷è}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Ñäåëàòü èãðó: ëåòàëêó-ñòðåëÿëêó');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                              if b=18 then begin  {Çàêëþ÷åíèå}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Ìíå ïîíðàâèëàñü ìîÿ ïðîãà   :-)');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                              if b=17 then begin  {ðóêîâîäñòâî ïîëüçîâàòåëþ}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                        write('Åñëè Âû â ýòîé ïðîãå íè÷åãî íå ïîìåíÿåòå');

                                           gotoxy(30,b+1);

                                           write('îíà áóäåò ðàáîòàòü ÂÅ×ÍÎ...');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                               if b=12 then begin  {ìàòåìàòè÷åñêèå ìåòîäû}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Çàäà÷à ñàìà ïî ñåáå íå ìàòåìàòè÷åñêàÿ,');

                                           gotoxy(30,b+1);

                                 write('çíà÷èò è ìàòåìàòè÷åñêèõ ìåòîäîâ íèêàêèõ íåò');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                                if b=13 then begin  {Îïèñàíèå äàííûõ}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Äàííûõ íåò...');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                                 if b=14 then begin  {Àëãîðèòì.áëîê-ñõåìà}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Ñìîòðè Ïîÿñíèòåëíóþ çàïèñêó');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                                  if b=16 then begin  {Òåêñòîâûå ïðèìåðû}

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           clrscr;

                                           gotoxy(30,b);

                                           write('Òåêñòîâûõ ïðèìåðîâ ó ìåíÿ òîæå íåò');

                                           repeat

                                                 a:=readkey;

                                           until a=chr(13);

                                           sound(4000);

                                           delay(1000);

                                           nosound;

                                           goto 1;

                                           end;

                                  if b=15 then begin

                                           sound(3000);

                                           delay(1000);

                                           nosound;

                                           jim;

                                           closegraph;

                                           goto 1;

                                           end;

                              end;

     until a=chr(27);

end.

4 Ðóêîâîäñòâî ïîëüçîâàòåëÿ äëÿ ðàáîòû â ïðîãðàììå.

Ïðè çàïóñêå ïðîãðàììû ïîÿâëÿåòñÿ ìåíþ, ïðåäëàãàþùåå øèðîêèé âûáîð ïóíêòîâ.

Êóðñîð ïåðåìåùàåòñÿ ïðè ïîìîùè êëàâèø êóðñîðà, âûáîð îñóùåñòâëÿåòñÿ êëàâèøåé ENTER .

Ïðè âûáîðå êàêîãî-ëèáî ïóíêòà ìåíþ ïîÿâëÿåòñÿ ñîîòâåòñòâóþùåå ñîîáùåíèå, îäíàêî æå, ïðè âûáîðå ïóíêòà «Ïðîãðàììà» çàïóñêàåòñÿ íåïîñðåäñòâåííî ñàìà èãðà.

Ñóòü èãðû çàêëþ÷àåòñÿ â ñáèâàíèè ëåòàþùèõ òàðåëîê ñðåäñòâîì ÏÂÎ.

Ñðåäñòâî ÏÂÎ ìîæåò ñ ïîìîùüþ êóðñîðà ïåðåìåùàòüñÿ ïî ýêðàíó â ãîðèçîíòàëüíîì íàïðàâëåíèè. Ïðè íàæàòèè êëàâèøè «ïðîáåë» ñðåäñòâî ÏÂÎ ñîâåðøàåò âûñòðåë. Åñëè ñíàðÿä ïîïàäàåò â ëåòàþùóþ òàðåëêó, òî îíà ñ÷èòàåòñÿ ñáèòîé è çà÷èñëÿåòñÿ â ôîíä èãðîêà, ÷òî ñèìâîëèçèðóåòñÿ ïîÿâëåíèåì çíà÷êà ñíàðÿäà â âåðõíåì ïðàâîì óãëó. Åñëè æå âûïóùåííûå ñíàðÿäû íå äîñòèãàþò öåëè è ëåòàþùàÿ òàðåëêà äîëåòàåò äî ïðàâîãî êðàÿ ýêðàíà, òî ýòî îòìå÷àåòñÿ òàêæå â ïðàâîì âåðõíåì óãëó ïîÿâëåíèåì çíà÷êà ëåòàþùåé òàðåëêè.

Èãðîê ïðîèãðûâàåò â ñëó÷àå äîñòèæåíèÿ ÷èñëà íå ñáèòûõ òàðåëîê ïðàâîãî êðàÿ ýêðàíà.

Èãðîê âûèãðûâàåò â ñëó÷àå äîñòèæåíèÿ ÷èñëà ñáèòûõ òàðåëîê ïðàâîãî êðàÿ ýêðàíà.

Ïîñëå ïðîèãðûøà ëèáî âûèãðûøà èãðà ïîâòîðÿåòñÿ.


Çàêëþ÷åíèå.

 ïðîöåññå îòëàäêè ïðîãðàììû âîçíèêëè ñëîæíîñòè ñ òåì, ÷òî ïðè ñêàíèðîâàíèè ïîëíîãî ýêðàíà è ïîñëåäóþùåì èñïîëüçîâàíèè ýòîãî îáúåêòà ïðîãðàììà íà÷èíàëà ðåçêî çàìåäëÿòü ñêîðîñòü ñâîåé ðàáîòû. Ïðåîäîëåíèå ýòîãî ïðåïÿòñòâèÿ  çàêëþ÷àëîñü â ñêàíèðîâàíèè íåáîëüøèõ ÷àñòåé ýêðàíà è äàëüíåéøåì èõ èñïîëüçîâàíèè.

Äëèòåëåí òàêæå ïðîöåññ äåòàëüíîé ïðîðèñîâêè ãðàôèêè.

Íåîáõîäèìî, ÷òîáû â òîé ïàïêå, ãäå ëåæèò äàííàÿ ïðîãðàììà, íàõîäèëñÿ ôàéë egavga.bgi . Ýòîò ôàéë èìååòñÿ âî ìíîãèõ âåðñèÿõ ÒÐ â ïàïêå bin, îí îòâå÷àåò çà èíèöèàëèçàöèþ ãðàôèêè.


Ñïèñîê èñïîëüçîâàííîé ëèòåðàòóðû.

1 Ìåæåííûé Î.À. «Turbo Pascal-ó÷èòåñü ïðîãðàììèðîâàòü»;Ìîñêâà-Ñ.Ïåòåðáóðã-Êèåâ; «Äèàëåêòèêà»;2001;448ñ.

2 Áàáóøêèí È.À.; «Ïðàêòèêóì ïî Òл-ó÷åáíîå ïîñîáèå ïî êóðñàì ÈÂÒ; Ìîñêâà, 1998.

3 http://www.freepascal.org;

4 http://www.geocities.com/~franzglaser/tp.htm;

5 http://www.garbo.uwasa.fi/pc/turboobj.html;


Ñòðàíèöû: 1, 2


Íîâîñòè


Áûñòðûé ïîèñê

Ãðóïïà âÊîíòàêòå: íîâîñòè

Ïîêà íåò

Íîâîñòè â Twitter è Facebook

                   

Íîâîñòè

Îáðàòíàÿ ñâÿçü

Ïîèñê
Îáðàòíàÿ ñâÿçü
Ðåêëàìà è ðàçìåùåíèå ñòàòåé íà ñàéòå
© 2010.