Skip to content

Instantly share code, notes, and snippets.

View egordorichev's full-sized avatar
🖊️
Available for hire

Egor Dorichev egordorichev

🖊️
Available for hire
View GitHub Profile
@leenattress
leenattress / proc.lua
Created April 18, 2017 23:14
Pico8 perlin noise example with infinite scrolling
pico-8 cartridge // http://www.pico-8.com
version 8
__lua__
-- @gabrielcrowe
-- some perlin noise and a scrolly desert
function _init()
local f={}
local p={}
local permutation={151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
@jackmott
jackmott / ShaderManager.cs
Created March 13, 2017 19:21
Hot Swappable Shaders for MonoGame
/*
HotSwap shader sytem for MonoGame
HotSwap code only exists for debug builds
Edit paths to match your project
Construct in your Initialize method
Add shaders in LoadContent (or whenever)
Call CheckForChanges in Update() or periodically however you like
mgcb.exe usually located in C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools
*/
@troeger
troeger / minecraft-server
Last active April 5, 2023 17:22
Running a Minecraft server as daemon on Amazon Linux
#!/bin/bash
#
# chkconfig: 2345 95 05
#
### BEGIN INIT INFO
# Provides: minecraft-server
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: $syslog
# Should-Stop: $syslog
@eliasdaler
eliasdaler / OBB.cpp
Last active April 28, 2024 20:56
OBB collision check and resolution using SAT (SFML, 2D)
// SAT collision check and resolution
// Public domain
// Usage example:
// if (testCollision(obb1, obb2, mtv)) { // obb1, obb2 - sf::RectangleShape, mtv - sf::Vector2f
// obb1.move(mtv);
// }
static const float NORMAL_TOLERANCE = 0.0001f;
using RectVertexArray = std::array<sf::Vector2f, 4>;
@Rami-Sabbagh
Rami-Sabbagh / LuaTable.lua
Last active July 5, 2020 17:03
A lua library that converts tables to Lua code that can be saved
local LuaTable = {
_VERSION = 'LuaTable v1.0.2 2016/08/27',
_AUTHOR = 'RamiLego4Game',
_URL = 'https://gist.github.com/RamiLego4Game/f656f5c1a118f77c3b7a08f4c65efaaf',
_DESCRIPTION = 'A library that converts tables to Lua code that can be saved',
_LICENSE = [[
MIT LICENSE
Copyright (c) 2016 Rami Sabbagh
@kometbomb
kometbomb / tweetjam.md
Last active June 27, 2023 13:00
PICO-8 tweetjam stuff

PICO-8 size optimization stuff for tweetcarts

Here are some simple ways to make your PICO-8 code fit in 140 280 characters (as in the #tweetjam #tweetcart craze). I did not invent these, I merely observed and collected them from the tweetjam thread.

LUA syntax stuff

  • Use single character variable names
  • Use x=.1 and x=.023, not x=0.1 or x=0.023
  • x=1/3 is shorter than x=.3333
  • You don't need to separate everything with spaces or write them on their own lines, e.g. circ(x,y,1)pset(z,q,7) works just as well
ImGuiStyle& style = ImGui::GetStyle();
style.Alpha = 1.0;
style.WindowFillAlphaDefault = 0.83;
style.ChildWindowRounding = 3;
style.WindowRounding = 3;
style.GrabRounding = 1;
style.GrabMinSize = 20;
style.FrameRounding = 3;
@richy486
richy486 / astar.p8
Created December 17, 2015 22:09
A* pathfinding in pico-8
pico-8 cartridge // http://www.pico-8.com
version 5
__lua__
-- A* pathfinding
-- by @richy486
function _init()
printh("---------------")
printh("starting a star")
@josefnpat
josefnpat / readme.md
Last active April 7, 2024 11:39
Going from Lua 5.2 to PICO-8's Lua

This information applies to the PICO-8 0.1.6 release.

This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.

You can always view the manual or yellowafterlife's extended 0.1.1 manual.

General

  • anything written in uppercase the PICO-8 editor or .p8 is made lowercase by the editor. → editing the .p8 file directly can work
  • print(function() end) outputs the string function instead of the string function: 0x0000000.
@sheenobu
sheenobu / main.lua
Created September 27, 2015 06:24
Love2D isometric rendering and picking
TileTable = {
{ 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1 },
{ 2, 2, 2, 2, 2, 2, 2 },
{ 3, 3, 3, 3, 3, 3, 3 },
{ 4, 4, 4, 4, 4, 4, 4 },
{ 5, 5, 5, 5, 5, 5, 5 },
{ 5, 5, 5, 5, 5, 5, 5 },
{ 5, 5, 5, 5, 5, 5, 5 },