ja guarda la configuracio
This commit is contained in:
89
source/legacy/asteroids.cpp
Executable file → Normal file
89
source/legacy/asteroids.cpp
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#define MARGE_DALT 20
|
||||
#define MARGE_BAIX 460
|
||||
@@ -12,21 +12,17 @@
|
||||
#define VELOCITAT_MAX 6
|
||||
#define MAX_BALES 3
|
||||
|
||||
struct ipunt
|
||||
{
|
||||
struct ipunt {
|
||||
float r;
|
||||
float angle;
|
||||
};
|
||||
|
||||
struct punt
|
||||
{
|
||||
struct punt {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
|
||||
struct triangle
|
||||
{
|
||||
struct triangle {
|
||||
ipunt p1, p2, p3;
|
||||
punt centre;
|
||||
float angle;
|
||||
@@ -35,8 +31,7 @@ struct triangle
|
||||
|
||||
typedef std::vector<ipunt> ivector();
|
||||
|
||||
struct poligon
|
||||
{
|
||||
struct poligon {
|
||||
ivector *ipunts;
|
||||
ivector ipuntx;
|
||||
punt centre;
|
||||
@@ -63,15 +58,16 @@ std::vector<poligon> bales(MAX_BALES);
|
||||
virt : ^pvirt;
|
||||
|
||||
procedure volca;
|
||||
var i:word;
|
||||
var i : word;
|
||||
begin
|
||||
for i:=1 to 38400 do mem[$A000:i]:=mem[seg(virt^):i];
|
||||
end;
|
||||
|
||||
procedure crear_poligon_regular(var pol:poligon;n:byte;r:real);
|
||||
var i:word;act,interval:real;aux:ipunt;
|
||||
begin
|
||||
{getmem(pol.ipunts,{n*464000);}
|
||||
procedure crear_poligon_regular(var pol : poligon; n : byte; r : real);
|
||||
var i : word;
|
||||
act, interval : real;
|
||||
aux : ipunt;
|
||||
begin {getmem(pol.ipunts,{n*464000);}
|
||||
interval:=2*pi/n;
|
||||
act:=0;
|
||||
for i:=0 to n-1 do begin
|
||||
@@ -388,7 +384,8 @@ begin
|
||||
rota_pol(pol,0,1);
|
||||
instalarkb;
|
||||
repeat
|
||||
{ rota_tri(nau,nau.angle,nau.velocitat,0);}
|
||||
{
|
||||
rota_tri(nau, nau.angle, nau.velocitat, 0);}
|
||||
clsvirt;
|
||||
|
||||
if teclapuls(KEYarrowright) then nau.angle:=nau.angle+0.157079632;
|
||||
@@ -415,17 +412,20 @@ begin
|
||||
if (dx>MARGE_ESQ) and (dx<MARGE_DRET) then
|
||||
nau.centre.x:=Dx;
|
||||
if (nau.velocitat>0.1) then nau.velocitat:=nau.velocitat-0.1;
|
||||
{ dist:=distancia(nau.centre,pol.centre);
|
||||
diferencia(pol.centre,nau.centre,puntaux);
|
||||
if dist<(pol.ipuntx[1].r+30) then begin
|
||||
nau.centre.x:=nau.centre.x
|
||||
+round(dist*cos(angle(puntaux)+0.031415));
|
||||
nau.centre.y:=nau.centre.y
|
||||
+round(dist*sin(angle(puntaux)+0.031415));
|
||||
end;}
|
||||
{ for i:=1 to 5 do begin
|
||||
rota_pol(orni[i],ang,0);
|
||||
end;}
|
||||
{
|
||||
dist:
|
||||
= distancia(nau.centre, pol.centre);
|
||||
diferencia(pol.centre, nau.centre, puntaux);
|
||||
if dist
|
||||
< (pol.ipuntx[1].r + 30) then begin nau.centre.x
|
||||
: = nau.centre.x + round(dist * cos(angle(puntaux) + 0.031415));
|
||||
nau.centre.y
|
||||
: = nau.centre.y + round(dist * sin(angle(puntaux) + 0.031415));
|
||||
end;}
|
||||
{ for
|
||||
i:
|
||||
= 1 to 5 do begin rota_pol(orni[i], ang, 0);
|
||||
end;}
|
||||
for i:=1 to MAX_ORNIS do begin
|
||||
mou_orni(orni[i]);
|
||||
rota_pol(orni[i],orni[i].rotacio,1);
|
||||
@@ -439,14 +439,27 @@ begin
|
||||
end;
|
||||
waitretrace;
|
||||
volca;
|
||||
{ if aux=1 then begin {gotoxy(0,0);write('tocado')tocado;delay(200);end;}
|
||||
gotoxy(50,24);
|
||||
write('<EFBFBD> Visente i Sergi');
|
||||
gotoxy(50,25);
|
||||
write('<EFBFBD>ETA 2.2 2/6/99');
|
||||
until teclapuls(keyesc);
|
||||
desinstalarkb;
|
||||
ang:=0;
|
||||
repeat waitretrace;rota_pol(pol,ang,0); ang:=ang+0.031415 ;rota_pol(pol,ang,1);until keypressed;
|
||||
text;
|
||||
end.
|
||||
{
|
||||
if aux
|
||||
= 1 then begin {
|
||||
gotoxy(0, 0);
|
||||
write('tocado') tocado;
|
||||
delay(200);
|
||||
end;
|
||||
}
|
||||
gotoxy(50, 24);
|
||||
write('<EFBFBD> Visente i Sergi');
|
||||
gotoxy(50, 25);
|
||||
write('<EFBFBD>ETA 2.2 2/6/99');
|
||||
until teclapuls(keyesc);
|
||||
desinstalarkb;
|
||||
ang:
|
||||
= 0;
|
||||
repeat waitretrace;
|
||||
rota_pol(pol, ang, 0);
|
||||
ang:
|
||||
= ang + 0.031415;
|
||||
rota_pol(pol, ang, 1);
|
||||
until keypressed;
|
||||
text;
|
||||
end.
|
||||
Reference in New Issue
Block a user