Log In  

Here I'll be posting modular resources for use in your cartridges! Each cartridge includes both shortened code, taking up a minimum of tokens, as well as expanded code, with lots of nice formatting and explanatory comments. They're all released under the zlib/libpng license so please feel free to use them in your own project!

Cart [#16719#] | Copy | Code | 2015-11-17 | Link

Like me, you may think the default font is kind of awful. If you do, here's some code that will help you render your own! The example font has 64 characters and starts at 0 in sprite memory, but you have full control over which characters are included and where they're located at and in which order they appear by making easy modifications to just a few variables. Take a look at the code to see how it's done!

Cart [#16720#] | Copy | Code | 2015-11-17 | Link

You might find yourself needing more input functionality than just btn and btnp. In this cartridge you can find functions to tell you when a button has been pressed (without repeating like btnp), when a button has been released, and how long a button has been pressed or how long it's been released.

Cart [#16736#] | Copy | Code | 2015-11-18 | Link

Pathfinding can be tricky, so this cartridge includes an implementation of the A* algorithm. This particular implementation is confined to pathfinding on 2D grids, but otherwise it's very flexible. You'll be able to assign your own movement cost and heuristic functions, and a good deal more. The implementation also comes with sensible defaults, so if you're not sure about the details you can mostly leave them up to the code as it is.

P#16717 2015-11-17 15:02


Cart [#16045#] | Copy | Code | 2015-10-31 | Link

Minesweeper! Features multiple difficulty levels and amazing sound effects. Released under the zlib/libpng license.

Arrows transport cursor and navigate menu
Z reveal tiles or activate menu options, menu opened when tiles not revealed
X flag tiles for knowledge

P#16046 2015-10-31 07:11

:: More
About | Contact | Updates | Terms of Use
Follow Lexaloffle:
Generated 2017-03-30 04:52 | 0.111s | 1835k