Skip to content

Instantly share code, notes, and snippets.

@jonbro
jonbro / gist:9fd4772a14d786486e9b
Last active August 29, 2015 14:17
generative audio in luxe/snow
import snow.platform.native.audio.openal.SoundStream;
import snow.audio.Audio;
import snow.types.Types;
import snow.io.typedarray.Uint8Array;
import snow.io.typedarray.Uint16Array;
import snow.io.typedarray.Int16Array;
import snow.io.typedarray.Float32Array;
import snow.Log;
import luxe.Rectangle;
import snow.platform.native.audio.openal.SoundStream;
import snow.audio.Audio;
import snow.types.Types;
import snow.io.typedarray.Uint8Array;
import snow.io.typedarray.Float32Array;
import snow.Log;
import luxe.Input;
class Main extends luxe.Game {
void fill_audio(void *udata, Uint8 *stream, int len)
{
int fLen = len/sizeof(float);
/* Mix as much data as possible */
// copy the output to the stream
for(int i=0;i<fLen;i+=2){
// =======================
//
// my c code goes here
@jonbro
jonbro / readme.txt
Last active August 29, 2015 14:12 — forked from anonymous/readme.txt
Play this game by pasting the script in http://www.???.com/editor.html
[Serializable]
public class ActionInput{
public enum ActionType
{
ENTER_TRIGGER,
EXIT_TRIGGER,
STAY_TRIGGER,
OBJECT_ACTIVE,
PRESS_KEY
}
@jonbro
jonbro / gist:beee59cbbf0475234dd0
Created November 5, 2014 23:16
propertydrawereditor
// C# example.
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomPropertyDrawer(typeof(ActionInput))]
public class ActionInputDrawer : PropertyDrawer {
public int rows = 1;
// Draw the property inside the given rect
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
@jonbro
jonbro / .gitignore
Created November 4, 2014 21:18
unity .gitignore
*.sln
*.userprefs
*.csproj
*.pidb
*.unityproj
.DS_Store
/Library/FailedAssetImports.txt
/Library/cache/
/Library/previews/
/Library/ScriptAssemblies
@jonbro
jonbro / gist:078c9bd121ce9c2d837b
Created July 29, 2014 18:59
what I have done
x tutorial doesn't work
x hide the standalone highscores on mobile
x entering the game while in landscape mode doesn't select the correct screen orientation
x game over screen doesn't work
x highscores might not be saving (can I connect the debug console to the device on android)
x might be related to above
x it seems like the steam stuff is what is causing it to break.
x rotating the screen clockwise into landscape mode doesn't display things correctly
x everything is super fucked on device :/
x it seems like the events on screen change aren't being dispatched
@jonbro
jonbro / gist:038adc9626d4b20ae302
Created May 21, 2014 13:18
poke the eyeball wwdiy clone game
ActorData = {
['location'] = Vec2(0,0);
['id'] = 'hand';
['art'] = {
{'hand.png'}
};
['actions'] = {
{
['triggers']={
{t="time", d="exactly", td=1};
@jonbro
jonbro / gist:89a21ee4a803339fcc46
Created May 21, 2014 13:15
data model from a wwdiy clone game
BananaData = {
['location'] = Vec2(0,0);
['id'] = 'banana';
['art'] = {
{'banana.png'}
};
['actions'] = {
{
['triggers']={