Calculator Community > HP Prime

4 games for the PRIME

(1/3) > >>

tgallo:
4 games for the PRIME
http://my.tbaytel.net/tgallo/hp prime

Mastermind


Minesweeper


Hangman


Simon

MacBernick:
Nice. I've already tried mastermind from hpcalc.org, I like it.

I see you use a lot concentric circles. I used that too in my very first PPL program. Maybe better (and faster ?) to use FILLPOLY since last update.

Sorunome:
Ah, those are for very nice games, great job! :thumbsup:

DJ Omnimaga:
That was quite nice. My favorite so far is the Minesweeper game. I often play it. I'll give the Simon's game a try soon.

By the way, a trick to get rid of the weird pixels when using that many circle commands is to copy the screen content in a GROB then paste it (with the background transparent) one pixel below. That said, it depends if you want to use those pixels as an effect or not, though.



I think FILLPOLY might work too, but I don't know if it can produce circles this smooth.


Welcome to the forums by the way! :)

MacBernick:

--- Quote from: DJ Omnimaga on January 08, 2014, 02:11:45 pm ---I think FILLPOLY might work too, but I don't know if it can produce circles this smooth.

--- End quote ---

Not too bad ^^


--- Code: ---FILLCIRCLE_P(cx, cy, r, color);

EXPORT circles()
BEGIN
   RECT();
   WHILE GETKEY() == -1 DO
      FILLCIRCLE_P(RANDINT(320), RANDINT(240), RANDINT(100), RANDINT(#FFFFFF));
   END;
END;

// quick, dirty and not optimal filled circles function
// (yeah, MAKELIST is better :p )
EXPORT FILLCIRCLE_P(cx, cy, r, color)
BEGIN
   LOCAL s, cl := {}, angle := HAngle;
   HAngle := 1;
   FOR s FROM 0 TO 359 STEP 10 DO
      LOCAL cp := {};
      cp := append(cp, EVAL(r * COS(s) + cx));
      cp := append(cp, EVAL(r * SIN(s) + cy));
      cl := append(cl, cp);
   END;
   HAngle := angle;
   FILLPOLY_P(cl, color);
END;
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version