Skip to content

Instantly share code, notes, and snippets.

View sabotai's full-sized avatar

Juno AM sabotai

View GitHub Profile
/*
//unity c# code
using UnityEngine;
using System.Collections;
using System.Net.Sockets;
using System.Text;
using System.Collections;
public class OSCSend : MonoBehaviour {
@sabotai
sabotai / spacebrew_arduino.pde
Created October 15, 2015 20:32
connect spacebrew and arduino for cclab
/*
* Button Example WITH ARDUINO SERIAL SUPPORT -- SEE BOTTOM FOR THE ARDUINO CODE
*
* Spacebrew library button example that send and receives boolean messages.
* COMBINED WITH ARDUINO SERIAL RECEIVE
*/
import spacebrew.*;
import processing.serial.*;
@sabotai
sabotai / Cannon.cs
Created October 27, 2015 17:10
unity cannon script
using UnityEngine;
using System.Collections;
public class Cannon : MonoBehaviour {
public Rigidbody bulletBlueprint; // assign in inspector
public Transform bulletOrigin; //position an object to use its position as a spawn point
public float bulletForce = 3000f; //this is the bullet speed. 3000 is the default
bool rotateToClick = false;
@sabotai
sabotai / nicolas.pde
Created February 17, 2016 21:46
GD105 Spring 2016 Week 3
PImage cage;
PImage bg;
int cageW, cageH;
int cageX, cageY;
void setup(){
size(1280,720);
bg = loadImage("funny_giraffe_25.jpg");
cage = loadImage("cagey.png");
@sabotai
sabotai / first.cs
Created February 22, 2016 19:38
in class 205 git gist example
using UnityEngine;
using System.Collections;
public class first : MonoBehaviour {
public GameObject textThing;
// Use this for initialization
void Start () {
textThing.GetComponent<TextMesh> ().text = "in quotation marks";
@sabotai
sabotai / creep.pde
Created February 24, 2016 21:36
GD105 Week 4 - Collisions, Conditionals
PImage creep; //make a new image called creep
int creepX, creepY; //make 2 new integers to track X and Y of creep
PImage newCreep; //second image container for arnold
Boolean collision; //is the collision happening? T/F
void setup(){
size(1280,720);
creep = loadImage("cagey.png"); //make sure your image is in the data folder
@sabotai
sabotai / trickyButton.pde
Last active March 2, 2016 23:21
Tricky button example from GD105 Week 5
int rectX, rectY, rectW, rectH;
void setup(){
size(1024, 640);
rectX = 200;
rectY = 200;
rectW = 100;
rectH = 75;
}
void draw(){
@sabotai
sabotai / nest.pde
Created March 9, 2016 21:43
in-class nested for loops
int times = 50; //how many times will we draw each row/column?
float dia = 5; //what will the diameter will be
void setup() {
size(500, 500); //our sketch will be 500 pixels by 500 pixels
}
void draw() {
background(255); //white background
for (int col = 1; col < times; col++) {
@sabotai
sabotai / bounce.pde
Created March 9, 2016 21:50
basic bounce example
PImage face; //new face object/container
int xPos, yPos; //variables to track our x and y positions
float xSpeed, ySpeed; //track the speeds along x and y axes
int faceDia; //a variable to hold the diameter of our image(face)
void setup(){
size(1280,720);
face = loadImage("face.png"); //load the image which is inside our data folder
@sabotai
sabotai / arrays.pde
Created March 30, 2016 20:36
For Loop/Array Flip Switch Example for GD105
int howMany = 45; //variable to keep track of how many
int[] x = new int[howMany]; //lets make a new array to keep track of x values
int[] y = new int[howMany]; //lets make a new array to keep track of y values
boolean[] beenClicked = new boolean[howMany]; //lets make a new array to keep track of which ones have been clicked
int dia = 100; //diameter of our ellipses
void setup(){
size(800,600);
for(int i = 0; i < howMany; i++){ //assign each of our x and y positions
x[i] = int(random(0,width)); //random x position up to the width of the window
y[i] = int(random(0,height));//random y position up to the height of the window