I made a simple port of Snake for the HP Prime featuring 2D and 3D game modes.
This is my first time working with Prime's micropython (wrapped in PPL) and its modules. I found myself struggling with the usage of some functions , especially the graphical ones, but i eventually got dimgrob and blit working, so i'm quite happy for now.

To run the game, just launch the program file. Some settings will be prompted by some "choice" boxes about game mode, size and difficulty level.

I still get some visual glitches in larger grids, and i still have not found a way to get that "busy" icon away (in top-right corner), so i'm open to every hint possible.

Please let me know how does it look and what you'd change.

Project repo:
https://github.com/ArcticDogsInc/snake_3d_prime/tree/master

Archive page:
https://www.cemetech.net/downloads/files/2784

ArcticDogsInc wrote:
This is my first time working with Prime's micropython (wrapped in PPL) and its modules.

When using PPL calls (hpprime.eval) in Python code, you must implement a safeguard against changes in system settings. The issue is that, depending on the Home Settings, PPL code may require either commas or dots as separators. For example: your game will not function correctly if a user sets Digit Grouping to the 5th item (using a comma as a decimal separator instead of a dot).

You can read more about it in my thread on hpmuseum: https://www.hpmuseum.org/forum/thread-23501.html
You will find an example there on how to handle this. You can use a try-except block or a context manager (I recommend the latter).

ArcticDogsInc wrote:
...and i still have not found a way to get that "busy" icon away (in top-right corner), so i'm open to every hint possible.


To hide the "busy" icon, simply replace:

Code:
graphic.clear_screen()

with

Code:
h.eval('RECT()')
komame wrote:
ArcticDogsInc wrote:
This is my first time working with Prime's micropython (wrapped in PPL) and its modules.

When using PPL calls (hpprime.eval) in Python code, you must implement a safeguard against changes in system settings. The issue is that, depending on the Home Settings, PPL code may require either commas or dots as separators. For example: your game will not function correctly if a user sets Digit Grouping to the 5th item (using a comma as a decimal separator instead of a dot).

You can read more about it in my thread on hpmuseum: https://www.hpmuseum.org/forum/thread-23501.html
You will find an example there on how to handle this. You can use a try-except block or a context manager (I recommend the latter).


Thank you! I did't notice that. Just fixed it with that nice context manager class.

komame wrote:

ArcticDogsInc wrote:
...and i still have not found a way to get that "busy" icon away (in top-right corner), so i'm open to every hint possible.


To hide the "busy" icon, simply replace:

Code:
graphic.clear_screen()

with

Code:
h.eval('RECT()')



It works 😁

I just submitted the new version to the archive page (v1.1 still pending at this moment) and on the github repo above.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement