This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
//unity c# code | |
using UnityEngine; | |
using System.Collections; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Collections; | |
public class OSCSend : MonoBehaviour { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer