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 | 2015-11-17 | Code ▽ | Embed ▽ | No License
16

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 | 2015-11-17 | Code ▽ | Embed ▽ | No License
16

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 | 2015-11-18 | Code ▽ | Embed ▽ | No License
16

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 ( Edited 2015-11-18 16:19)

:: matt

Nice work all round! Very useful.

I'd love to see things like this able to be added to a game using plugin or framework architecture.

P#16740 2015-11-18 11:19 ( Edited 2015-11-18 16:19)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-06-04 06:11 | 0.020s | 2097k | Q:44