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
function drawfish(cfish,fishx,fishy,scale) | |
srand(cfish.seed) | |
local length=flr(20+cfish.size*5) | |
length=min(length,120) | |
local keycount=-flr(-length/(5+rnd(20))) | |
local keys={} | |
keys[1]=0 | |
for i=2,keycount do | |
keys[i]=(rnd(length/8)+length/16)*scale |
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
fluid={} | |
poke(0x5f2d,1) | |
function spawndrop(x,y) | |
// {x, y, old_x, old_y, hit_count} | |
add(fluid,{x,y,x,y,1}) | |
end | |
function sortfluid() | |
for i=2,#fluid do |
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
-- clear the screen | |
cls() | |
-- make a shorter alias far pico8's | |
-- "get random number" function. | |
-- usage: r(10) means "random number in [0,10)" | |
r=rnd | |
-- print "grow" to the screen, | |
-- a weird shorthand for print("grow") |
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
-- "bar" contains: | |
-- pt1 {x, y, vx, vy} or {x, y, oldx, oldy} | |
-- pt2 {x, y, vx, vy} or {x, y, oldx, oldy} | |
-- dist (intended distance between points) | |
function updatebar(bar) | |
-- find the current vector between our points | |
local dx = bar.pt1.x-bar.pt2.x | |
local dy = bar.pt1.y-bar.pt2.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
// AutoCopyToGPU, written by Eli Piilonen in 2020, MIT license | |
// Whenever your C# scripts compile, structs/consts/enums that you | |
// mark with [CopyToGPU] will be copied to a shader-include file. | |
// DO NOT put this file in an Editor folder! It will break. | |
///// C# Usage: | |
// | |
// [CopyToGPU] |