HP Forums
HP Prime: Waterfall Animation - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: HP Prime: Waterfall Animation (/thread-411.html)



HP Prime: Waterfall Animation - Eddie W. Shore - 01-11-2014 11:24 PM

Background boxes with falling water. There is random mist coming from the water.
Colors:
Blue: #FFh, RGB(0,0,255)
White: #FFFFFFh, RGB(255,255,255)
Brown: #964B00h, RGB(150,75,0)
Green Grass: #DA00h, RGB(0,218,0)

Code:
EXPORT AMNI10()
BEGIN
// 2014-01-10 Waterfall EWS
LOCAL K,J,I,A:=0;
RECT();

WHILE GETKEY==-1 DO
A:=A+1;

// Static 
// Walls
RECT_P(0,5,30,210,#964B00h);
RECT_P(280,5,318,210,#964B00h);
// Water
RECT_P(30,10,280,210,#FFh);
// Grass
TRIANGLE_P(0,210,155,230,318,210,
RGB(0,218,0));

// Animated
// Mist
FOR I FROM 1 TO RANDINT(50,75) DO
TEXTOUT_P(".",RANDINT(30,270),
RANDINT(10,200),3,#FFFFh); END;
// Foam
FOR I FROM 1 TO RANDINT(100,125) DO
TEXTOUT_P("=",RANDINT(25,290),
RANDINT(200,210),3,#FFFFFFh); END;
// Fall
RECT_P(30,10+25*(A+1),280,10+25*A,
#FFFFFFh);
WAIT(0.1);
IF A==8 THEN
A:=0; END;

END;

END;



RE: HP Prime: Waterfall Animation - Kevin Ouellet - 01-12-2014 07:11 AM

I get syntax error when compiling your code. Could you post an .hpprgm version?


RE: HP Prime: Waterfall Animation - Terje Vallestad - 01-12-2014 11:12 AM

(01-12-2014 07:11 AM)Kevin Ouellet Wrote:  I get syntax error when compiling your code. Could you post an .hpprgm version?

I think there is an END; statement missing at the end of the file

Cheers, Terje


RE: HP Prime: Waterfall Animation - Kevin Ouellet - 01-12-2014 06:22 PM

Ah right, I got it working now.

For some reasons this reminds me some Atari 2600 stuff. Tongue


RE: HP Prime: Waterfall Animation - Eddie W. Shore - 01-12-2014 10:48 PM

(01-12-2014 06:22 PM)Kevin Ouellet Wrote:  Ah right, I got it working now.

For some reasons this reminds me some Atari 2600 stuff. Tongue

Smile Atari 2600 - I'll have to work on a more realistic waterfall.

I added the last END; command. It should work now.