Skip to content

Tatone26/Numworks-games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numworks Games

Some simple games for numworks calculator, to run in python or as applications ! I make these game for fun and to learn Rust and give myself a challenge by programming on a very limited device.

Most of the games here should work as perfectly as I could make them but don't expect anything crazy !

Python Games

Everything needs the menu.py script downloaded as well.

  • Snake : An incredible classic, a lot of fun if you are motivated. The default settings are the hardest one, try to beat 20 or so points! See the Apps for a better one!
  • Connect4 : Simple but efficient and fun to play with friends. You can even play with strange rules or at 3 players! See the Apps for a better one!
  • Chess : Not finished, but still technically playable. Almost no rules are implemented but basic movement.
  • 2048 : Works but pretty bad looking compared to the original.
  • Solitaire : A fully functional Classic Solitaire! See the Apps for a better one!
  • Battleship : My first game, which I made even before the introduction of the timing module in python. Not a really good one.

Thanks to ZetaMap, you can run these python scripts on your pc with the Kandinksy and the Ion-Numworks modules installed to test them. You can find a lot more programs on numworks.com, where anyone can submit their own.

Applications

Feel free to download and copy the code it if you want, but it's quite messy as I work alone.

Remember that it is a calculator so it is NOT a game console at all !

I'm also using these projects to learn some Rust, as I am already used to code in C. The code I write is probably not idiomatic at all and anyone good in Rust shouldn't want to read that.

PS : These games are tested on a real N0110 and the latest version of the Epsilon software.

Instructions and controls are included in the games themselves!

  • Snake : My take on the classic game!

  • Puissance4 (Connect 4): You can play against your friend or a basic but strong AI, and even try some 3 players games !

  • Solitaire : A Classic Solitaire, with classic rules.

  • Tetris : Yeah. Tetris! I think I followed every rule of the original game.

  • Flappy Bird : Everybody know Flappy Bird. As of today, it is by far the most technically advanced game I made. (and the one I worked the most on)

  • Numworks_utils contains a lot of the utility code I use : the numworks default functions, the entire menu code, graphical tools and more.

  • Model is a basic repo you can copy to start your game using my template.

  • Nppm_decoder is a build utility I made to process the images at compile time. Necessary to use the tiling module.

There are still a lot of impossible things with the official software (like saving data), so consider installing an other one like Omega if you want to do some really complex things.

If you want to create some apps that run on Epsilon, see the Rust-based template, C++ and C.

Installation instructions :

  • go to the "apps" folder
  • download the .nwa file(s) of the game(s) you want
  • go to my.numworks.com/apps (on chromium)
  • follow the instructions on the website, and put the file(s) you downloaded.
  • click DOWNLOAD and you're good to go !

Some technical details of the Numworks calculator

Or what make these games more difficult to make than you think

As I'm not an expert at all, I won't talk about the truly technical stuff. You can start here if you want more details.

  • The RAM is only 256kb, and the stack is only 32kb. I know you can use around 125kb + 32kb of this RAM in the applications. It is really small but by being careful, it does not cause a lot of problems.
  • There is no heap and no std, so no malloc to use. This changes a lot of things, but the heapless crate can solve most problems. I still had to rewrite some very basic functions, as I didn't want to import another crate.
  • The screen is 320x240 pixels and uses RGB565 (16 bits) colors. That means you need 2 bytes / pixel when drawing anything, which is a lot in this context.
  • The refresh rate is not bad (45Hz) BUT it works from the top-left to the bottom-right. This means that rectangles drawn too late in the frame can look really bad in the bottom-right corner. It seems to be a good pratice to draw from right to left if possible.
  • The VBlank time is pretty small too, so it is next to impossible to draw the entire screen. It is definitely able too, but I couldn't find how with the tools we have.