Skip to content

Instantly share code, notes, and snippets.

View andymasteroffish's full-sized avatar

Andy Wallace andymasteroffish

View GitHub Profile
@andymasteroffish
andymasteroffish / pm_compressed.p8
Last active September 27, 2023 19:22
Compressed code for my #Pico1K Jam 2023 entry, Pico Mace
c=-1::i::d=1t=0e=198f={e=99,f=99,o=0,d=0,r=.9,i=15,t=12,h=3}i={f}h=0p=0r=1g=0for n=0,30do add(i,{e=rnd(e),f=rnd(e),i=4,t=5,h=4})if n<6then add(i,{e=90+n,f=90,o=0,d=0,r=.97,i=8,t=12,h=2})end end::e::l=rnd()if t%40<d then add(i,{e=99+cos(l)*e,f=99+sin(l)*e,i=1,t=8,h=4})end if t%8<1then add(i,{e=99+cos(l)*e,f=99+sin(l)*e,r=1,o=1-rnd(2),d=1-rnd(2),i=0,g=600,t=10,h=5})end t+=1if btn(0)then f.o-=.3end if btn(1)then f.o+=.3end if btn(2)then f.d-=.3end if btn(3)then f.d+=.3end camera(f.e-64+rnd(h),f.f-64+rnd(h))h=max(h-.7,0)g-=.02if g<0then r=1end for n in all(i)do a=1o=0if n.o then n.e+=n.o n.f+=n.d n.o*=n.r n.d*=n.r o=atan2(n.o,n.d)end if n.i<1then a,o=7,t/99end if n.i>8then a=4end if n.i==8then b=f.e-n.e v=f.f-n.f n.o+=b/50n.d+=v/50n.t=12if abs(n.o)+abs(n.d)<3then n.t=1end for e in all(i)do if e.i>7and abs(n.e-e.e)+abs(n.f-e.f)<n.i then b=n.e-e.e v=n.f-e.f n.o+=b/9n.d+=v/9end end end if n.i==1then o=atan2(f.e-n.e,f.f-n.f)n.e+=cos(o)*d n.f+=sin(o)*d a=4end if n.i<3then for e in all(i)do if e.i>7and e.t>9and abs(e.e
-- Cold Sun Surf
-- https://andymakes.itch.io/cold-sun-surf
-- Code by Andy Wallace
-- andymakes.com
-- Made for PICO-1K jam https://itch.io/jam/pico-1k-2022
-- This is a breakdown of the compressed code. The code is identical. All I have added is white space and comments.
-- You can copy/paste this code to Pico-8 and mess with it if you'd like.
cls()
circfill(64,64,11)
?"\^w\^tcold sun surf",14,99
?"by @andy_makes"
memcpy(0,24576,16384)
c=cos
s=sin
r=rnd
pal({9,2,5,130,132,129})
t=0
--[[
1k jump
by andy wallace
@andy_makes
andymakes.com
you can play the game here: https://andymakes.itch.io/1k-jump
that page has the original 1013 byte code as well
@andymasteroffish
andymasteroffish / Hau_kun_sketch.cpp
Created May 27, 2021 19:57
Source code for a plotter drawing based on a @Hau_kun tweet
// Original tweet by @Hau_kun
// https://twitter.com/Hau_kun/status/1397547848015638532
// Made in openFrameworks
// Using ofGCode
// https://github.com/andymasteroffish/ofxGCode
void ofApp::setup(){
ofxGCode gcode;
pico-8 cartridge // http://www.pico-8.com
version 29
__lua__
--hand cram
--by @andy_makes
--playable at https://andymakes.itch.io/hand-cram
--**********************************
--original, 557 char code
#include <Keyboard.h>
//Code by Mark Kleback for IMS Jam Jam Revolution
//http://www.kleebtronics.com/
//button pins
int button1 = 9;
int button2 = 10;
//storing the button state to detect changes
@andymasteroffish
andymasteroffish / firefox_fullscreen.ahk
Created May 30, 2018 17:19
Fire Fox fullscreener for DreamBoxXx
; some code from https://autohotkey.com/board/topic/17656-breaking-an-infinite-loop-with-keypress/
Loop,
{
;loop waiting for it to launch
Loop,
{
WinWait, Mozilla Firefox, , 5
if ErrorLevel
{
;do nothing
@andymasteroffish
andymasteroffish / dream_launcher_autohotkey.ahk
Last active May 30, 2018 16:56
AutoHotkey script that managed the DreamBoxXx
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SETUP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Game Variables
Launcher_Path = "C:/Users/BUBSTAR/Desktop/dream/launcher/dream_launcher.exe"
; General Interface Settings
Start_With_Hidden_Cursor = 1
@andymasteroffish
andymasteroffish / html_launch_function.cpp
Created May 29, 2018 20:27
openFrameworks function to launch a website used for Dream BoxXx
void ofApp::launchWeb(string url) {
if (isFullScreened()) {
ofToggleFullscreen();
}
std::wstring pathTemp = std::wstring(url.begin(), url.end());
LPCWSTR pathLPC = pathTemp.c_str();
ShellExecute(0, 0, pathLPC, 0, 0, SW_MAXIMIZE);