Skip to content

Instantly share code, notes, and snippets.

View Liquidream's full-sized avatar

Paul Nicholas Liquidream

View GitHub Profile
@Liquidream
Liquidream / lumon8-commented.p8
Last active September 14, 2022 14:56
Fully commented source code for Lumon-8, a 1KB PICO-8 demake of the MDR program from the TV show Severance (made for #Pico1k jam 2022)
-- lumon-8 (#pico1k)
-- paul nicholas
--
-- step 1: initialisation
--
poke(24365,1) -- enable mouse support
-- (custom font related)
-- first define the size of the custom font
poke(22016,4,4,6)
@Liquidream
Liquidream / index.html
Last active July 31, 2022 18:28
Itch.io Web Template for Pico1k Jam submission
<!DOCTYPE html>
<html>
<body style="margin: 0; padding: 0; height: 100%; width: 100%; background-color:#111111">
<!--
Replace src value below with URL from PICO-8 Education Edition
(after doing: SAVE @URL from PICO-8 console)
-->
<iframe style="height: 555px; width: 100%;" scrolling="no" frameborder="0"
src="https://www.pico-8-edu.com/?c=OjpfOjoKcHJpbnQoIocgaXRjaC5pbyBydWxlcyCHIixybmQoMTUpKQpmbGlwKCkKZ290byBf&g=w-w-w-w1HQHw-w2Xw-w3Xw-w2HQH">
</iframe>
@Liquidream
Liquidream / p8pathfinder-edit.p8
Created March 12, 2019 14:27
Pathfinder... with diagonals?
-- returns any neighbor map
-- position at which flag zero
-- is unset
function map_neighbors(node, graph)
local neighbors = {}
if (not fget(mget(node.x - 1, node.y - 1), 0)) add(neighbors, {x=node.x - 1, y=node.y - 1})
if (not fget(mget(node.x, node.y - 1), 0)) add(neighbors, {x=node.x, y=node.y - 1})
if (not fget(mget(node.x + 1, node.y - 1), 0)) add(neighbors, {x=node.x + 1, y=node.y - 1})
if (not fget(mget(node.x - 1, node.y), 0)) add(neighbors, {x=node.x - 1, y=node.y})
if (not fget(mget(node.x + 1, node.y), 0)) add(neighbors, {x=node.x + 1, y=node.y})
@Liquidream
Liquidream / gradient.lua
Created November 27, 2017 20:18
A quick gradient example using FILLP()
-- quick gradient example using fillp()
-- by paul nicholas
::_::
cls(12)
fillp()
rectfill(0,55,127,60,7)
fillp(0b1000000000100000)
rectfill(0,60,127,70,0x67)
@Liquidream
Liquidream / outline_sprite.p8.lua
Last active October 23, 2021 16:20
Useful sprite draw function for PICO-8 (and maybe Lua in general)
--
-- draws a sprite to the screen with an outline of the specified colour
--
function outline_sprite(n,col_outline,x,y,w,h,flip_x,flip_y)
-- reset palette to black
for c=1,15 do
pal(c,col_outline)
end
-- draw outline
for xx=-1,1 do