HP Prime : Angry Birds



#2

Hello everybody,

I'm presenting you my new game : Angry Birds for HP Prime (touch edition).
With your finger, set power and angle (set by the last position of your finger at the end of a "drag") and then press ENTER to launch your bird.
10 levels.

Video : http://youtu.be/7lXs_kJtn1Q

Donwload

PS: You can see the menu from the program editor (bug ?)


#3

From entry line

ANGRY_BIRDS(); [ENTER] => ... Shows the history background =( =[

PD:
It requires a format with highlighter editor plugin (scripts ) for HP-Prime

http://www.pspad.com/en/

Source code

EXPORT ANGRY_BIRDS()
BEGIN
//By Mickaƫl Nicotera
local touch;
LOCAL X,Y,A,B,C,S,T,E;
LOCAL W,G,H,J;
LOCAL L1,L2;

S:=0;
E:=10;
L1:={1,1,1};
L2:={#78FF37h,#303030h};
W:=1;
G:=RANDOM(60,170);
H:=RANDOM(60,170);
J:=RANDOM(60,170);

WHILE E>0 DO

IF irem(S,30)==0 AND S>29 AND E<>10-W THEN
W:=W+1;
E:=10-W;
L1:={1,1,1};
G:=RANDOM(60,170);
H:=RANDOM(60,170);
J:=RANDOM(60,170);
END;

X:=0;
Y:=190;

DIMGROB_P(G1,320,220);
RECT_P(G1,RGB(73,194,255));
RECT_P(G1,20,200,60,240,RGB(127,70,0),RGB(127,70,0));
FOR I FROM 1 TO 6 DO
ARC_P(G1,40,193,7-I,0,360,RGB(244,30,30));
END;
FOR I FROM 0 TO 2 DO
LINE_P(G1,43,189+I,51,189+I,RGB(255,161,1));
END;

RECT_P(G1,200,G,240,240,RGB(127,70,0),RGB(127,70,0));
FOR I FROM 1 TO 6 DO
ARC_P(G1,220,G-6,7-I,0,360,L2(L1(1)));
END;
RECT_P(G1,240,H,280,240,RGB(127,70,0),RGB(127,70,0));
FOR I FROM 1 TO 6 DO
ARC_P(G1,260,H-6,7-I,0,360,L2(L1(2)));
END;
RECT_P(G1,280,J,320,240,RGB(127,70,0),RGB(127,70,0));
FOR I FROM 1 TO 6 DO
ARC_P(G1,300,J-6,7-I,0,360,L2(L1(3)));
END;

TEXTOUT_P("Tries = "+E,G1,200,7,1,RGB(255,244,43));
TEXTOUT_P("Score = "+S,G1,250,7,1,RGB(255,244,43));
TEXTOUT_P("ANGRY BIRDS",G1,80,7,3,RGB(255,255,255));
TEXTOUT_P("Power ",G1,25,22,1,RGB(255,0,0));
TEXTOUT_P("By Mic ",G1,138,22,1,RGB(255,255,255));

TEXTOUT_P("Level "+W,G1,118,198,1,RGB(255,255,255));

WHILE ISKEYDOWN(30)<>1 do
blit_p(G0,G1,0,0);

touch:=mouse();

LINE_P(52,190,72,Y-20);
RECT_P(20,10,20+iquo(X,6),20,RGB(255,0,0),RGB(255,0,0));
WAIT(0.1);

if size(touch(1)) then

IF touch(1,5)==2 THEN

X:=B&#8594;R(touch(1,1));
Y:=B&#8594;R(touch(1,2));

LINE_P(52,190,72,Y-20);

RECT_P(20,10,20+iquo(X,6),20,RGB(255,0,0),RGB(255,0,0));

end;
end;

END;

A:=0.008-(230-Y)/70000;
B:=2.71+(40-Y)/500+(X-50)/500;
C:=305-X/10;
T:=0;
E:=E-1;
TEXTOUT_P("Score = "+S,G1,250,7,1,RGB(255,244,43));

IF (G-19<A*220^2-B*220+C<G+6) AND L1(1)<>2 THEN
S:=S+10;
L1(1):=2;
END;
IF (H-19<A*260^2-B*260+C<H+6) AND L1(2)<>2 THEN
S:=S+10;
L1(2):=2;
END;
IF (J-19<A*300^2-B*300+C<J+6) AND L1(3)<>2 THEN
S:=S+10;
L1(3):=2;
END;

M:=51;
N:=189;
FOR I FROM 1 TO 30 DO
TEXTOUT_P("o",M,N,1,RGB(255,41,38));
M:=M+10;
N:=A*M^2-B*M+C;
WAIT(0.2);
END;

END;

MSGBOX("Score = "+S);

END;

Edited: 26 Oct 2013, 12:29 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Engineers without calculators form angry mob Norris 1 900 07-12-2006, 02:25 AM
Last Post: Walter B

Forum Jump: