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: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465:
| unit CapMan;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; BitBtn1: TBitBtn; Timer1: TTimer;
procedure FormKeyPress(Sender: TObject; var Key: Char); procedure FormCreate(Sender: TObject); procedure Waende; procedure Timer1Timer(Sender: TObject); private public end;
var Form1: TForm1 ; x : integer = 200; y : integer = 200; c : integer; r: integer = 20; t: integer = 40; s: integer = 20; fm : integer = clblack; fh : integer = clblack; x1: integer = 40 ; x11: integer = 40 ; x21: integer = 240 ; x2: integer = 80 ; x12: integer = 40 ; x22: integer = 280 ; x3: integer = 120 ; x13: integer = 40 ; x23: integer = 320 ; x4: integer = 160 ; x14: integer = 40 ; x24: integer = 360 ; x5: integer = 200 ; x15: integer = 40 ; x25: integer = 360 ; x6: integer = 240 ; x16: integer = 40 ; x26: integer = 360 ; x7: integer = 280 ; x17: integer = 80 ; x27: integer = 360 ; x8: integer = 320 ; x18: integer = 120 ; x28: integer = 360 ; x9: integer = 360 ; x19: integer = 160 ; x29: integer = 360 ; x10: integer = 40 ; x20: integer = 200 ; x30: integer = 360 ; w : array [1..100, 1..2] of integer; rp: integer = 10; mx: integer = 300; my:integer = 300; implementation {$R *.dfm}
procedure TForm1.Waende; begin
canvas.Brush.color:=clgreen; canvas.pen.Color:=clgreen; canvas.rectangle(0,0,20,form1.height-20); canvas.Rectangle(0,0,form1.Width,20); canvas.Rectangle(form1.Width-40,0,form1.Width,form1.Height); canvas.Rectangle(0,form1.Height-60,form1.Width,form1.Height); w[1,2]:=40; w[11,2]:=120; w[21,2]:=320; w[2,2]:=40; w[12,2]:=160; w[22,2]:=320; w[3,2]:=40; w[13,2]:=200; w[23,2]:=320; w[4,2]:=40; w[14,2]:=240; w[24,2]:=320; w[5,2]:=40; w[15,2]:=280; w[25,2]:=80; w[6,2]:=40; w[16,2]:=320; w[26,2]:=120; w[7,2]:=40; w[17,2]:=320; w[27,2]:=160; w[8,2]:=40; w[18,2]:=320; w[28,2]:=200; w[9,2]:=40; w[19,2]:=320; w[29,2]:=240; w[10,2]:=80; w[20,2]:=320; w[30,2]:=280;
canvas.Pen.Color:=clyellow; canvas.Brush.Color:=clyellow; canvas.Ellipse(x1-rp,w[1,2]-rp,x1+rp,w[1,2]+rp); canvas.Ellipse(x2-rp,w[2,2]-rp,x2+rp,w[2,2]+rp); canvas.Ellipse(x3-rp,w[3,2]-rp,x3+rp,w[3,2]+rp); canvas.Ellipse(x4-rp,w[4,2]-rp,x4+rp,w[4,2]+rp); canvas.Ellipse(x5-rp,w[5,2]-rp,x5+rp,w[5,2]+rp); canvas.Ellipse(x6-rp,w[6,2]-rp,x6+rp,w[6,2]+rp); canvas.Ellipse(x7-rp,w[7,2]-rp,x7+rp,w[7,2]+rp); canvas.Ellipse(x8-rp,w[8,2]-rp,x8+rp,w[8,2]+rp); canvas.Ellipse(x9-rp,w[9,2]-rp,x9+rp,w[9,2]+rp); canvas.Ellipse(x10-rp,w[10,2]-rp,x10+rp,w[10,2]+rp); canvas.Ellipse(x11-rp,w[11,2]-rp,x11+rp,w[11,2]+rp); canvas.Ellipse(x12-rp,w[12,2]-rp,x12+rp,w[12,2]+rp); canvas.Ellipse(x13-rp,w[13,2]-rp,x13+rp,w[13,2]+rp); canvas.Ellipse(x14-rp,w[14,2]-rp,x14+rp,w[14,2]+rp); canvas.Ellipse(x15-rp,w[15,2]-rp,x15+rp,w[15,2]+rp); canvas.Ellipse(x16-rp,w[16,2]-rp,x16+rp,w[16,2]+rp); canvas.Ellipse(x17-rp,w[17,2]-rp,x17+rp,w[17,2]+rp); canvas.Ellipse(x18-rp,w[18,2]-rp,x18+rp,w[18,2]+rp); canvas.Ellipse(x19-rp,w[19,2]-rp,x19+rp,w[19,2]+rp); canvas.Ellipse(x20-rp,w[20,2]-rp,x20+rp,w[20,2]+rp); canvas.Ellipse(x21-rp,w[21,2]-rp,x21+rp,w[21,2]+rp); canvas.Ellipse(x22-rp,w[22,2]-rp,x22+rp,w[22,2]+rp); canvas.Ellipse(x23-rp,w[23,2]-rp,x23+rp,w[23,2]+rp); canvas.Ellipse(x24-rp,w[24,2]-rp,x24+rp,w[24,2]+rp); canvas.Ellipse(x25-rp,w[25,2]-rp,x25+rp,w[25,2]+rp); canvas.Ellipse(x26-rp,w[26,2]-rp,x26+rp,w[26,2]+rp); canvas.Ellipse(x27-rp,w[27,2]-rp,x27+rp,w[27,2]+rp); canvas.Ellipse(x28-rp,w[28,2]-rp,x28+rp,w[28,2]+rp); canvas.Ellipse(x29-rp,w[29,2]-rp,x29+rp,w[29,2]+rp); canvas.Ellipse(x30-rp,w[30,2]-rp,x30+rp,w[30,2]+rp);
end;
procedure TForm1.FormCreate(Sender: TObject); begin canvas.Brush.Color:=fh; canvas.rectangle(0,0,Form1.Height,Form1.Width); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r);
Waende;
end;
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); begin if (x=x1) and (y=w[1,2]) then inc(x1,form1.Width+100); if (x=x2) and (y=w[2,2]) then inc(x2,form1.Width+100); if (x=x3) and (y=w[3,2]) then inc(x3,form1.Width+100); if (x=x4) and (y=w[4,2]) then inc(x4,form1.Width+100); if (x=x5) and (y=w[5,2]) then inc(x5,form1.Width+100); if (x=x6) and (y=w[6,2]) then inc(x6,form1.Width+100); if (x=x7) and (y=w[7,2]) then inc(x7,form1.Width+100); if (x=x8) and (y=w[8,2]) then inc(x8,form1.Width+100); if (x=x9) and (y=w[9,2]) then inc(x9,form1.Width+100); if (x=x10) and (y=w[10,2]) then inc(x10,form1.Width+100); if (x=x11) and (y=w[11,2]) then inc(x11,form1.Width+100); if (x=x12) and (y=w[12,2]) then inc(x12,form1.Width+100); if (x=x13) and (y=w[13,2]) then inc(x13,form1.Width+100); if (x=x14) and (y=w[14,2]) then inc(x14,form1.Width+100); if (x=x15) and (y=w[15,2]) then inc(x15,form1.Width+100); if (x=x16) and (y=w[16,2]) then inc(x16,form1.Width+100); if (x=x17) and (y=w[17,2]) then inc(x17,form1.Width+100); if (x=x18) and (y=w[18,2]) then inc(x18,form1.Width+100); if (x=x19) and (y=w[19,2]) then inc(x19,form1.Width+100); if (x=x20) and (y=w[20,2]) then inc(x20,form1.Width+100); if (x=x21) and (y=w[21,2]) then inc(x21,form1.Width+100); if (x=x22) and (y=w[22,2]) then inc(x22,form1.Width+100); if (x=x23) and (y=w[23,2]) then inc(x23,form1.Width+100); if (x=x24) and (y=w[24,2]) then inc(x24,form1.Width+100); if (x=x25) and (y=w[25,2]) then inc(x25,form1.Width+100); if (x=x26) and (y=w[26,2]) then inc(x26,form1.Width+100); if (x=x27) and (y=w[27,2]) then inc(x27,form1.Width+100); if (x=x28) and (y=w[28,2]) then inc(x28,form1.Width+100); if (x=x29) and (y=w[29,2]) then inc(x29,form1.Width+100); if (x=x30) and (y=w[30,2]) then inc(x30,form1.Width+100);
if (x1>form1.Width)and(x2>form1.Width)and(x3>form1.Width)and(x4>form1.Width)and(x5>form1.Width) and(x6>form1.Width)and(x7>form1.Width)and(x8>form1.Width)and(x9>form1.Width)and(x10>form1.Width) and(x11>form1.Width)and(x12>form1.Width)and(x13>form1.Width)and(x14>form1.Width)and(x15>form1.Width) and(x16>form1.Width)and(x17>form1.Width)and(x18>form1.Width)and(x19>form1.Width)and(x20>form1.Width) and(x21>form1.Width)and(x22>form1.Width)and(x23>form1.Width)and(x24>form1.Width)and(x25>form1.Width) and(x26>form1.Width)and(x27>form1.Width)and(x28>form1.Width)and(x29>form1.Width)and(x30>form1.Width) then begin canvas.Brush.Color:=fh; canvas.rectangle(0,0,Form1.Height,Form1.Width); Label1.Visible:=TRUE; Label2.Visible:=TRUE; bitbtn1.Visible:=True; showmessage('YOU WIN');
end else if Key = ('d') then begin Application.ProcessMessages; if not (x>form1.Width-80) then inc(x,s); c:=round((Form1.Width-x)/sin(45)*sin(90)); canvas.Brush.Color:=fh; canvas.rectangle(0,0,Form1.Height,Form1.Width); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); Waende; canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,y+c,Form1.Width,y-c); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,round(y+c/2),Form1.Width,round(y-c/2)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,round(y+c/4),Form1.Width,round(y-c/4)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,y,Form1.Width,y-1); canvas.Pen.Color:=clyellow; canvas.Moveto(x,y); canvas.Lineto(x+r,y); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,round(y+c/4),Form1.Width,round(y-c/4)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,round(y+c/2),Form1.Width,round(y-c/2)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,Form1.Width,y+c,Form1.Width,y-c); end
else if Key = 'a' then begin Application.ProcessMessages; if x>40 then dec(x,s); c:=round(x/sin(45)*sin(90)); canvas.Brush.Color:=fh; canvas.rectangle(0,0,Form1.Height,form1.Width); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); Waende; canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,y-c,0,y+c); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,round(y-c/2),0,round(y+c/2)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,round(y-c/4),0,round(y+c/4)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,y,0,y+1); canvas.Pen.Color:=clyellow; canvas.Moveto(x,y); canvas.Lineto(x-r,y); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,round(y-c/4),0,round(y+c/4)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,round(y-c/2),0,round(y+c/2)); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,0,y-c,0,y+c); end
else if Key = 'w' then begin Application.ProcessMessages; if y>40 then dec(y,s); c:=round(y/sin(45)*sin(90)); canvas.Brush.Color:=fh; canvas.rectangle(0,0,Form1.Height,form1.Width); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); Waende; canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,x+c,0,x-c,0); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x+c/2),0,round(x-c/2),0); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x+c/4),0,round(x-c/4),0); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,x+1,0,x,0); canvas.Pen.Color:=clyellow; canvas.Moveto(x,y); canvas.Lineto(x,y-r); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x+c/4),0,round(x-c/4),0); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x+c/2),0,round(x-c/2),0); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,x+c,0,x-c,0);
end
else if Key = 's' then begin Application.ProcessMessages; if y<form1.Height-80 then inc(y,s); c:=round((Form1.Height-y)/sin(45)*sin(90)); canvas.Brush.Color:=fh; canvas.rectangle(0,0,Form1.Height,form1.Width); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); Waende; canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,x-c,Form1.Height,x+c,Form1.Height); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x-c/2),Form1.Height,round(x+c/2),Form1.Height); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x-c/4),Form1.Height,round(x+c/4),Form1.Height); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,x,Form1.Height,x+1,Form1.Height); canvas.Pen.Color:=clyellow; canvas.Moveto(x,y); canvas.Lineto(x,y+r); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x-c/4),Form1.Height,round(x+c/4),Form1.Height); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,round(x-c/2),Form1.Height,round(x+c/2),Form1.Height); sleep(t); canvas.Pen.Color:=fh; canvas.Brush.color:=clyellow; canvas.Ellipse(x-r,y-r,x+r,y+r); canvas.Pen.Color:=fm; canvas.Brush.color:=fm; canvas.Pie(x-r,y-r,x+r,y+r,x-c,Form1.Height,x+c,Form1.Height); end; end;
procedure TForm1.Timer1Timer(Sender: TObject); var i :integer; begin
end;
end. |