Bouncing Mac
program Mac;
uses Types, QuickDraw, Events;

var 
	i, x, y, sx, sy, color: Integer;
	mac, mscreen: Rect;
	
begin
	x := random mod 280 + 10;
	y := random mod 150 + 10;
	sx := 1;
	sy := 1;
	
	graphics(320);
	clearScreen(black);
	hideCursor;
	
	repeat
	
		{ Draw Mac }
		
		setRect(mac, x, y, x + 20, y + 30);
		setSolidPenPat(15);	
		paintRect(mac);
		setRect(mscreen, x + 2, y + 3, x + 18, y + 15);
		setSolidPenPat(4);
		paintRect(mscreen);
		setSolidPenPat(black);
		moveTo(x + 10, y + 22);
		line(7, 0);

		{ Erase Mac }

		setRect(mac, x - 1, y - 1, x + 21, y + 31);
		setSolidPenPat(black);
		frameRect(mac);
		
		{ Move Mac }
		
		x := x + sx;
		y := y + sy;
		
		if (x < 0) or (x > 300) then
			sx := -sx;
		
		if (y < 0) or (y > 170) then
			sy := -sy;
			
		for i := 1 to 9999 do;
	until button(0);
end.
Bouncing Mac! This program teaches animation technique.
Sample Codes
Hosted by www.Geocities.ws

1