Skip to content

Instantly share code, notes, and snippets.

View tinyhappysteps's full-sized avatar

tinyhappysteps

View GitHub Profile
@tinyhappysteps
tinyhappysteps / basicAI_ant.cs
Created February 15, 2016 14:24
GameMaster.cs and WhiteAnt.cs - basic AI working
// GameMaster.cs ***
using UnityEngine;
using System.Collections;
public class GameMaster : MonoBehaviour {
public GameObject whiteAnt;
// Use this for initialization
@tinyhappysteps
tinyhappysteps / LoseCollider.cs
Last active January 25, 2016 13:22
Basic Collider with trigger in Unity
// Running project : https://www.dropbox.com/s/zs1i64zviep4i4h/Collider.zip?dl=0
using UnityEngine;
using System.Collections;
public class LoseCollider : MonoBehaviour {
void OnTriggerEnter2D (Collider2D trigger) {
print ("trigger " + trigger);
}
@tinyhappysteps
tinyhappysteps / Work.cs
Created January 5, 2016 14:55
Hello World Unity App - Simple Unity3d Button click and text updates
// Unity project here: https://www.dropbox.com/s/8nsuolthw2dzv4b/My%20Second%20Game%20Attempt.zip?dl=0
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class Work : MonoBehaviour {
public Text text;
@tinyhappysteps
tinyhappysteps / TextController.cs
Created December 14, 2015 14:43
Simple text game working with Enum - Unity
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class TextController : MonoBehaviour {
public Text text;
private enum States {cell, sheets_0, sheets_1, lock_0, lock_1, mirror, cell_mirror, freedom};
private States myState;
// Use this for initialization
void Start () {
myState = States.cell;
@tinyhappysteps
tinyhappysteps / TextController.cs
Created December 13, 2015 14:21
Text UI in Unity
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // brings in UI information
public class TextController : MonoBehaviour {
public Text text; // requires UnityEngine.UI, publicly exposes the text
// Use this for initialization
void Start () {
@tinyhappysteps
tinyhappysteps / NumberWizards.cs
Created December 13, 2015 13:23
Improved number wizard -- unity
using UnityEngine;
using System.Collections;
public class NumberWizards : MonoBehaviour {
int max = 1000;
int min = 1;
int guess = 500;
// Use this for initialization
@tinyhappysteps
tinyhappysteps / NumberWizardsStar.cs
Last active December 7, 2015 14:44
Unity basic script working - Number Wizard
using UnityEngine;
using System.Collections;
public class NumberWizards : MonoBehaviour {
int max = 1000;
int min = 1;
int guess = 500;
// Use this for initialization
@tinyhappysteps
tinyhappysteps / CloudKitWorking.swift
Last active October 5, 2015 15:40
Save and Fetch Private DB in CloudKit
// Don't forget to set capabilities to iCloud on, Cloudkit
import UIKit
import CloudKit
class ViewController: UIViewController {
let database = CKContainer.defaultContainer().privateCloudDatabase
enum CarType: String{
@tinyhappysteps
tinyhappysteps / ViewController.swift
Created September 17, 2015 16:40
Swift Resume Audio AVFoundation - AVQueuePlayer AVPlayer
import UIKit
import AVFoundation
var player: AVQueuePlayer!
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
@tinyhappysteps
tinyhappysteps / Callback example
Created September 14, 2015 13:49
Javascript / Node.js / MongoDB callback example
// Function with callback
var getPayerIDs = function(db, callback) {
console.log("is db null?:" + (db == null));
var condition = new Object();
condition.iap_status = "success";
condition.receipt = {$in: [/^129/, /GPA./]};
db.collection('android_uc_iap').distinct("device_id", condition, function (err, docs) {
callback(docs);
});