program MegaBALL; var waiting, x, y, xStep, yStep, down, up, len, speed, go: integer; fon, kur: image; procedure gameOver(go: integer); begin drawImage(kur,0,150); setColor(0,0,0); drawText('Vu nabrali '+IntegerToString(go)+' ochkov',10,150); repaint; delay(9000); end; begin waiting := 0; kur := loadImage('/kur.png'); fon := loadImage('/fon.jpg'); while (waiting < 200) do begin drawImage(fon, 0, 0); setColor(0, 0, 0); drawRect(17, 143, 205, 26); drawRect(18, 144, 203, 24); drawRect(19, 145, 201, 22); setColor(255, 255, 0); fillRect(20, 146, waiting, 21); drawText('MegaBALL', 120 - GetStringWidth('MegaBALL') / 2, 5); waiting := waiting + 1; setColor(100, 100, 100); drawText(' ' + waiting / 2 + '%', 107, 145); setColor(0, 0, 0); drawText('Naik Software', 120 - GetStringWidth('Naik Software') / 2, 280); repaint; end; x := 50 + random(150); y := 100 + random(100); xStep := 1; yStep := 1; down := 100; up := 100; len := 40; speed := 0; go := 0; while (true) do begin drawImage(fon, 0, 0); if (x > -1) and (x < 256) then setColor(255, x, 255 - x); drawText(' ' + go, 100, 150); if (y <= 10) and (x > up - 20) and (x < up + len) then begin go := go + 1; if (go > 10) and (go < 20) then speed := 1; if (go > 20) and (go < 30) then speed := 2; if (go > 30) and (go < 40) then speed := 3; if (go > 40) and (go < 50) then speed := 4; if (go > 50) then speed := 5; if (x < up - 10) then begin xStep := -(random(2)) - speed; if (xStep = 0) then xStep := -2; end; if (x > up + len -10) then begin xStep := random(2) + speed; if (xStep = 0) then xStep := 2; end; yStep := 1 + speed; y := 10; end; if (y >= 290) and (x > down - 20) and (x < down + len) then begin go := go + 1; if (go > 10) and (go < 20) then speed := 1; if (go > 20) and (go < 30) then speed := 2; if (go > 30) and (go < 40) then speed := 3; if (go > 40) and (go < 50) then speed := 4; if (go > 50) then speed := 5; if (x < down - 10) then begin xStep := -(random(2)) - speed; if (xStep = 0) then xStep := -2; end; if (x > down + len - 10) then begin xStep := random(2) + speed; if (xStep = 0) then xStep := 2; end; yStep := -1 - speed; y := 290; end; if (x <= 0) then xStep := 1 + speed; if (x >= 220) then xStep := -1 - speed; if (y <= -20) then gameOver(go); if (y >= 320) then gameOver(go); x := x + xStep; y := y + yStep; fillEllipse(x, y, 20, 20); setColor(0, 0, 255); if (getKeyPressed = KE_KEY7) then down := down - speed - 1; if (getKeyPressed = KE_KEY9) then down := down + speed + 1; if (down < 0) then down := 0; if (down > 240 - len) then down := 240 - len; if (getKeyPressed = KE_KEY1) then up := up - speed - 1; if (getKeyPressed = KE_KEY3) then up := up + speed + 1; if (up < 0) then up := 0; if (up > 240 - len) then up := 240 - len; fillRoundRect(down, 310, len, 10, 3, 3); fillRoundRect(up, 0, len, 10, 3, 3); repaint; end; end.