/nokiajam-pico8-template

a template + instructions for using PICO-8 for the Nokia 3310 game jam

Primary LanguageHTMLMIT LicenseMIT

nokiajam-pico8-template

a template + instructions for using the PICO-8 game engine for the Nokia 3310 game jam

PICO-8 doesn't support changing the resolution or color palette, but this guide will show how to do it anyway (in HTML exports)

features

  • nokia3310 color palette
  • 84x48 resolution
  • 15fps

HOW TO MAKE YOUR GAME

  • edit game.p8
  • the first tab has a bare-bones game with an _update() and _draw() function as usual
  • draw your game between 0,0 and 83,47 (inclusive)
    • there's a call to camera() in the last tab that will make drawing happen in a central region onscreen (if you want to use camera() yourself you will need to account for this)
    • the reason it's centered is so that the player can use the pause menu. however, the pause menu uses black pixels which I don't currently know how to re-color, so the pause menu is disabled
  • the last tab is "engine code" that makes the project run at 15 fps in the correct position onscreen. you shouldn't need to edit this tab

HOW TO EXPORT

  1. intial setup
    • open PICO-8
    • run folder config -- this will open a folder in your OS
    • navigate to the plates subfolder
    • download plates/nokia3310.html and save it in this folder
  2. exporting
    • inside PICO-8, run export -p nokia3310 -f mycoolgame.html
  3. setting the label image
    • manually create an 84x48 image with the correct colors
    • convert the image to base64
    • open mycoolgame_html/index.html in a text editor
    • search for .p8_start_button{ and replace the background:url section with your base64 image-string
  4. replace palette
    • option 1 (manual)
      • open mycoolgame_html/mycoolgame.js in a text editor
      • find this string...:
        • 29,43,83,126,37,83,0,135,81,171,82,54,95,87,79,194,195,199,255,241,232,255,0,77,255,163,0,255,236,39,0,228,54,41,173,255,131,118,156,255,119,168,255,204,170
        • ...and replace it with this string:
        • 67,82,61,67,82,61,67,82,61,67,82,61,67,82,61,199,240,216,199,240,216,199,240,216,199,240,216,199,240,216,199,240,216,199,240,216,199,240,216,199,240,216,199,240,216
        • (it's in there twice, replace both of them)
    • option 2 (automatic)
      • for commmandline folks: edit the change-palette.sh shell script (you'll need to change a path) and then run it

palette

  • the exporting process (described above) replaces the colors 1-15 with the nokia3310 colors #43523d and #c7f0d8, like this:

color palette; 0 is black, 1-5 are dark green, 6-15 are light green

Color 0 will remain black -- don't use color 0 in your game. Use colors 1 (dark) and 7 (light) (or any combination of dark+light from the table)

license / credits


TODO

  • custom font
    • note when porting: the classic 3310 font on the jam resources page has many small mistakes, e.g. "M" "W" "S"
  • custom pause menu example
    • nevermind, the screen is centered on the pause menu now. but the color palette is a big issue -- the pause menu is black
    • one possibility might be shaders, instead of editing the palette
  • sfx example - instr 3 (green) ?