HP Forums

Full Version: HP Prime: Waterfall Animation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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;
I get syntax error when compiling your code. Could you post an .hpprgm version?
(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
Ah right, I got it working now.

For some reasons this reminds me some Atari 2600 stuff. Tongue
(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.
Reference URL's