1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
{$FRAME_WIDTH 432}
{$FRAME_HEIGHT 24}
{$FRAME_RATE 4}
{$BACKGROUND $545454}{Couleurs.DarkGray}
program Bits;
(* FlashPascal 2 v14.04.22 *)
uses
Flash8, Couleurs;
const
MaxInt = $7FFFFFFF;
type
TPoint = class(MovieClip)
procedure Tracer;
constructor Create(Depth, x, y, Color: Integer);
procedure SetColor(Color: Integer);
end;
procedure TPoint.Tracer;
begin
MoveTo(0, -4);
CurveTo(+4, -4, +4, 0);
CurveTo(+4, +4, 0, +4);
CurveTo(-4, +4, -4, 0);
CurveTo(-4, -4, 0, -4);
end;
constructor TPoint.Create(Depth, x, y, Color: Integer);
begin
inherited Create(nil, '', Depth);
LineStyle(0, Color);
BeginFill(Color);
Tracer;
EndFill();
_x := x;
_y := y;
end;
procedure TPoint.SetColor(Color: Integer);
begin
LineStyle(0, Color);
BeginFill(Color);
Tracer;
EndFill();
end;
var
a: array[0..31] of TPoint;
i: Integer;
type
Horloge = class(MovieClip)
procedure onEnterFrame; override;
end;
procedure Horloge.onEnterFrame;
var
x: Integer;
begin
if i < MaxInt then
begin
for x := 0 to 31 do
if i and (1 shl x) > 0 then
a[31 - x].SetColor(LawnGreen)
else
a[31 - x].SetColor(Gray);
Inc(i);
end;
end;
var
x: Integer;
begin
for x := 0 to 31 do
a[x] := TPoint.Create(
x + 1,
12 * x + 12 * (x div 8) + 12,
12,
Gray
);
i := 0;
stage.scaleMode := 'noScale';
Horloge.Create(nil, 'h', 0);
end. |
Partager