Skip to content

Instantly share code, notes, and snippets.

@jakevsrobots
jakevsrobots / GoogleAnalytics.cs
Created May 16, 2012 22:23
A few utilities for triggering google analytics events from within Unity.
using UnityEngine;
public class GoogleAnalytics {
public static string gameIdentifier = "YourGameName";
public static void TrackEvent(string eventName, string eventLabel="") {
string googleAnalyticsCall = "_gaq.push(['_trackEvent', '" + GoogleAnalytics.gameIdentifier + "', '" + eventName + "'";
if(eventLabel != "") {
googleAnalyticsCall += ", '" + eventLabel + "'";
@jakevsrobots
jakevsrobots / flickr_bot.java
Created February 23, 2012 17:17
Processing sketch that fetches stuff from twitter & flickr
ArrayList imageList;
int currentImageIndex = 0;
ArrayList fetchNewImages(String keyword) {
XMLElement xml = new XMLElement(this, "http://api.flickr.com/services/feeds/photos_public.gne?tags=" + keyword + "&lang=en-us&format=rss_200");
XMLElement[] linkTags = xml.getChildren("entry/link");
ArrayList imageList = new ArrayList();
@jakevsrobots
jakevsrobots / cheapmarkovtweets.java
Created February 22, 2012 22:18
Processing sketch that does a fake markov chain type reprocessing of a twitter search feed
void setup() {
// Fetch recent tweets from twitter with a certain keyword
XMLElement xml = new XMLElement(this, "http://search.twitter.com/search.atom?q=lasertag");
XMLElement[] tweets = xml.getChildren("entry/title");
String corpus = "";
for(int i=0; i<tweets.length; i++) {
corpus += tweets[i].getContent();
}
#pragma strict
#pragma downcast
class SpeakingCharacter extends MonoBehaviour {
// ------------------------------------------
// Properties
// ------------------------------------------
public var characterName : String;
public var conversationXMLFile : TextAsset;
package beulah {
import org.flixel.*;
public class Background extends FlxGroup {
private var cloudsOne:FlxSprite;
private var cloudsTwo:FlxSprite;
private var landOne:FlxSprite;
private var landTwo:FlxSprite;
private var screenTestPoint:FlxPoint;
private var season:String;
// InfiniteOutsideState.as
package beulah {
import org.flixel.*;
public class InfiniteOutsideState extends FlxState {
private var worldChunks:FlxGroup;
private var worldChunkMap:Object;
private var currentWorld:Object;
#!/usr/bin/python
import os, sys
from xml.dom import minidom
#--------------------------------------
BASE_PATH = os.path.dirname(__file__)
MAP_SRC_DIR = os.path.join(BASE_PATH, 'data/maps')
MAP_COMPILED_DIR = os.path.join(BASE_PATH, 'data/maps/compiled')