program PofMP; var running, blobsize,xs, ys, vibra_duration, ispause, ke, key: integer; acceleration, gravity: real; scr: array[1] of integer; location: array[1] of real; speed: array[1] of real; info: command; procedure ext; begin running := 2; showAlert('thanks', 'thanks for playing', loadImage('/icon.png'), ALERT_INFO); repaint; delay(5000); showForm; halt; end; begin // power of mobpascal... // Skyezeno // shows the power of mobpascal // Thanks to vl@Volk and Vasiliy_LiGhT // from pys60 to mpas running := 1; scr[0] := getWidth; scr[1] := getHeight; acceleration := 0.05; gravity := 0.03; speed[0] := 0.; speed[1] := 0.; blobsize := 16; xs := scr[0]-16; ys := scr[1]-16; location[0] := scr[0]/2; location[1] := scr[1]/2; vibra_duration := 70; ispause := 2; ke := getKeyPressed; key := keyToAction(ke); showAlert('help', 'D-PAD - Move, * - Exit. Enjoy!', loadImage('/icon.png'), ALERT_INFO); info := createCommand('Ok', CM_OK, 1); addCommand(info); repaint; repeat delay(100); until getClickedCommand <> emptyCommand; showForm; while running = 1 do begin if isMidletPaused then ispause := 1; if ispause = 1 then begin setColor(255,255,255); drawText('Paused', scr[0]/2-10, scr[1]/2-10); ispause := 2; repeat delay(100); until getKeyPressed = KE_POUND; end; setColor(0,0,0); fillRect(0,0,scr[0],scr[1]); setColor(0,255,0); fillEllipse(trunc(location[0] + blobsize / 2), trunc(location[1] - blobsize / 2), blobsize, blobsize); speed[0] := speed[0] * 0.999; speed[1] := speed[1] * 0.999; speed[1] := speed[1] + gravity; location[0] := location[0] + speed[0]; location[1] := location[1] + speed[1]; if location[0]>xs then begin vibro(vibra_duration); location[0] := xs - (location[0] - xs); speed[0] := -0.80 * speed[0]; speed[1] := 0.90 * speed[1]; end; if location[0] < 0 then begin vibro(vibra_duration); location := -location[0]; speed[0] := -0.80 * speed[0]; speed[1] := 0.90 * speed[1]; end; if location[1] > ys then begin if speed[1] > 3 then begin vibro(vibra_duration); location[1] := -location[1]; speed[0] := 0.90 * speed[0]; speed[1] := -0.80 * speed[1]; end; end; if location[1] < 0 then begin vibro(vibra_duration); location[0] := -location[0]; speed[0] := 0.90 * speed[0]; speed[1] := -0.80 * speed[1]; end; if key = GA_LEFT then speed[0] := speed[0] - acceleration; if key = GA_RIGHT then speed[0] := speed[0] + acceleration; if key = GA_DOWN then speed[1] := speed[1] + acceleration; if key = GA_UP then speed[1] := speed[1] - acceleration; if getKeyClicked = KE_STAR then ext; repaint; end; end.