Skip to content

Instantly share code, notes, and snippets.

pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
-- count down clock for faust game jam 2018 https://itch.io/jam/faust-game-jam modified by arch.jslin
-- original from 1stclock! by ultrabrite: https://www.lexaloffle.com/bbs/?tid=30199
-- yyyy mm dd hh mm ss
endt={2018, 8,25,14, 0, 0}
stitle1="faust game jam"
stitle2="2018 timer"
@arch-jslin
arch-jslin / font
Last active December 17, 2015 11:28
My letter to a fellow developer in a discussion about free Chinese font license technicalities.
[snipped]
In fact we are also running into this problem in our own game,
about the "partially embedded" font. And as I dug deeper into this,
I only see more and more restrictions.
For now, I can only say that all freely-available Chinese fonts
I have researched are at least restricted by GPL, and actually
there are only 2 of them available (though they have different
font faces and weights in their font family):
local counter = 0
local function proc1()
while counter < 100000000 do
counter = counter + 1
coroutine.yield()
end
end
local function proc2()
@arch-jslin
arch-jslin / misspell.lua
Created December 1, 2011 09:10
misspell.lua
local input = arg[1]
math.randomseed(os.time())
local function random(n) return math.floor(math.random()*n) end
local function chararray(w)
local t = {};
for i = 1, #w do t[i] = w:sub(i,i) end
return t
end
@arch-jslin
arch-jslin / main.cpp
Created November 18, 2011 15:03
Simple C++ class in a main executable, see if luajit ffi should be able to resolve symbols.
#include <cstdio>
#include <cstdlib>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include "luajit.h"
}
@arch-jslin
arch-jslin / simple_jit.lua
Created November 18, 2011 14:56 — forked from gaspard/simple_jit.lua
Testing Luajit bindings to C++
local ffi = require 'ffi'
local C = ffi.C
ffi.cdef[[
typedef struct Simple Simple;
Simple *Simple_Simple(int);
void Simple__gc(Simple *);
int Simple_id(Simple *);
@arch-jslin
arch-jslin / 123
Created November 18, 2011 14:54 — forked from gaspard/gist:1087380
#include <cstdio>
#include <cstdlib>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include "luajit.h"
}
@arch-jslin
arch-jslin / blah.lua
Created May 31, 2011 15:21
just blah
function Game:process_dropping(now_t, last_t)
self.cubes:for2d(function(c)
if c:is_waiting() then
if self:is_below_empty(c) then
drop_cube_logical(c, self.cubes)
drop_cube(c, now_t, last_t)
end
elseif c:is_dropping() then
drop_cube(c, now_t, last_t)
if c:arrived_at_logical_position() then
@arch-jslin
arch-jslin / surfaceview.java
Created February 23, 2011 17:45
surfaceview.java
//igdshare 110220: code provided by hsufong
class MainPlan extends SurfaceView implements SurfaceHolder.Callback {
private DrawPlanThread drawplanThread;
public MainPlan(Context context) {
super(context);
getHolder().addCallback(this);
drawplanThread = new DrawPlanThread(getHolder(), this);
}
private boolean XYInRect(int fX,int fY,Rect fRect){
boolean tInside = false;
@arch-jslin
arch-jslin / saveGameData.java
Created February 23, 2011 17:44
saveGameData.java
//igdshare 110220: code provided by hsufong
private int saveGameData(int fIndex){
String saveFileName = "/data/data/com.mobile_sango/sangoSave"+fIndex+".bin";
String description = setSaveDescription();
FileOutputStream fosFile;
OutputStream fosDes;
File saveFile = new File(saveFileName);
if (!saveFile.exists()){
try {