This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- 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 |