home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ultimate Game Collection
/
XULTI.ISO
/
396
/
bounce.rpp
< prev
next >
Wrap
Text File
|
1996-12-08
|
2KB
|
203 lines
{ Bounce by Keebler }
var x1 : number;
var y1 : number;
var xv1: number;
var yv1: number;
var x2 : number;
var y2 : number;
var xv2: number;
var yv2: number;
var x3 : number;
var y3 : number;
var xv3: number;
var yv3: number;
var Counter: number;
var Trails: number;
x1:=50;
y1:=50;
xv1:=2;
yv1:=1;
x2:=150;
y2:=150;
xv2:=-2;
yv2:=-3;
x3:=150;
y3:=50;
xv3:=3;
yv3:=1;
Counter:=16;
Trails:=0;
{====================== Menu ======================}
setcolor(1);
println(" Commands ");
println("===================");
println(" (C) Clear Screen ");
println(" (T) Toggle Trails ");
println(" ");
println(" ");
println(" (SPACE) to start ");
println(" (ESC) to exit ");
$WaitForKey
if (kbcode(57))
goto $Start
endif;
if (kbcode(1))
end;
endif;
goto $WaitForKey
$Start
cls(0);
$Loop {============== Main Loop ==================}
delay(15);
if (Trails=1)
setcolor(Counter-1);
endif;
if (Trails=0)
setcolor(0);
endif;
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
if (Counter=255)
Counter:=16;
endif;
Counter:=Counter + 0.5;
if (kbcode(20))
if (Trails=1)
Trails:=2;
endif;
if (Trails=0)
Trails:=1;
endif;
if (Trails=2)
Trails:=0;
endif;
endif;
if (kbcode(46))
cls(0);
endif;
if (kbcode(1))
goto $End
endif;
x1:=x1+xv1;
y1:=y1+yv1;
x2:=x2+xv2;
y2:=y2+yv2;
x3:=x3+xv3;
y3:=y3+yv3;
if ((x1>319)or(x1<0))
xv1:=xv1*(-1);
x1:=x1+xv1;
endif;
if ((y1>199)or(y1<0))
yv1:=yv1*(-1);
y1:=y1+yv1;
endif;
if ((x2>319)or(x2<0))
xv2:=xv2*(-1);
x2:=x2+xv2;
endif;
if ((y2>199)or(y2<0))
yv2:=yv2*(-1);
y2:=y2+yv2;
endif;
if ((x3>319)or(x3<0))
xv3:=xv3*(-1);
x3:=x3+xv3;
endif;
if ((y3>199)or(y3<0))
yv3:=yv3*(-1);
y3:=y3+yv3;
endif;
setcolor(Counter);
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
goto $Loop
$End
setcolor(1);
end;