Skip to content

Instantly share code, notes, and snippets.

View sabotai's full-sized avatar

Juno AM sabotai

View GitHub Profile
@sabotai
sabotai / catloljk.pde
Created April 6, 2016 20:35
Basic Physics Example
float posX, posY;
float speedX, speedY;
float size;
float gravity = 0.4;
boolean isMoving;
PImage cat = new PImage();
void setup(){
@sabotai
sabotai / classesObjectsYeah.pde
Last active May 7, 2016 00:36
Enemy Class Example
//Enemy someEnemy; //declare a new object of the class "Enemy"
Enemy[] manyEnemies;
void setup(){
size(1280,600);
// someEnemy = new Enemy(); //initialize our new enemy object
manyEnemies = new Enemy[20];
for (int i = 0; i < manyEnemies.length; i++){
@sabotai
sabotai / SceneLoad.cs
Last active May 19, 2024 12:01
Easy Trigger Scene Load Unity
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
//HOW TO USE::
//make a new "C# Script" in the project tab and give it the name "SceneLoad"
//open up the new script and paste the entire contents
//attach the new script to your player object
//Create a new GameObject, adding one of the Collider2D components
//check the "is trigger" box for the collider settings
@sabotai
sabotai / DestroyCollision.cs
Last active May 10, 2016 21:41
Unity destroy upon collision 2D
using UnityEngine;
using System.Collections;
public class DestroyCollision : MonoBehaviour { //in the project tab of Unity, make a new "C# Script" called "DestroyCollision"
public string tagName; //this will show up as an input box for the component, which can be given a tag of your choice. assign the
void OnCollisionEnter2D(Collision2D myCol) { //run the following whenever a collision happens to the object attached with this script
Debug.Log("Collision with " + myCol.gameObject);
@sabotai
sabotai / week2.pde
Created September 1, 2016 20:32
GD105 Week 2 - Variables
//declare a new int called howManyHoursOfSleep and assign it a value of 6
int howManyHoursOfSleep = 6;
void setup(){ //this runs once
size(1920,1080); //make the windows this size
//i could also assign a value in here
//howManyHoursOfSleep = 6;
}
@sabotai
sabotai / Move.cs
Created September 6, 2016 20:23
gd205 week 2 homework
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
public int playerX, playerZ;
public GameObject textObject;
// Use this for initialization
void Start () {
@sabotai
sabotai / week3.pde
Created September 8, 2016 20:40
GD105 Fall 2016 Week 3
PImage beyonce;
PImage bg;
int bW, bH;
int bX, bY;
void setup(){
size(1280,720);
@sabotai
sabotai / Move.cs
Created September 13, 2016 21:15
GD205 Week 3 - Move
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
public GameObject textThing;
bool hasKey;
public Vector3[] verboten;
@sabotai
sabotai / stopBox.pde
Created September 15, 2016 21:35
GD105 Fall 2016 Week 4
int x;
int y;
int w;
int h;
int bg;
Boolean toTheLeft;
@sabotai
sabotai / MoveWKey.cs
Created September 20, 2016 20:40
GD205 Week 4 In-Class
using UnityEngine;
using System.Collections;
public class MoveWKey : MonoBehaviour {
public GameObject textThing;
bool hasKey;
public GameObject key;