Skip to content

Instantly share code, notes, and snippets.

View Hotrian's full-sized avatar
💭
Coding!

Nicholas Ewalt Hotrian

💭
Coding!
View GitHub Profile
# Reach the end of the maze using move commands.
# Count how many gems you pick up, and then say the current count when near a fireball trap to disable it.
# The raven at the start will give you a password. Say the password near a door to open it.
# Kill ogres when you get near them.
# You can use a loop to repeat all of the instructions as needed.
# If you beat this level, you can skip to the Forest World!
canAttack = False;
gemCount = 0;
password = "Swordfish";
steps = [0, 1, 1, 1, 0, 6, 2, 1, 5, 1, 1, 0, 7, 0, 0, 3, 3, 3, 3];
using UnityEngine;
using System.Collections;
public class EnemyShipAI : MonoBehaviour {
public float detectRange = 8f; // Maximum range at which to target and chase the player
public float attackRange = 4f; // Maximum range at which to fire straight forward
public float targetDistance = 2f; // Maximum approach distance to target
public float moveSpeed = 0.02f; // Movement speed
using UnityEngine;
using System.Collections;
public class BulletScript : MonoBehaviour {
// Destroy the parent game object when it is no longer visible
void OnBecameInvisible() {
Destroy( gameObject);
}
void OnTriggerEnter2D( Collider2D other) {
// #TODO Explosion effect, sound effects, etc
using UnityEngine;
using System.Collections;
/* For use with BrightnessByRGBACamera
*
* Adds this script to the global probe list
*
* Feel free to use in any project
*/
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/* For use with BrightnessByRGBAProbe
*
* Takes a screen shot of regions around the probes,
* and assigns values to the probes
*
* Feel free to use in any project
using UnityEngine;
using System.Collections;
/*
* Demonstrates how to test for children probes
*
* Feel free to use in any project
*/
// V2
using UnityEngine;
using System.Collections;
/*
* This script causes the main camera to follow the attached gameObject.
*
* It allows for deadzones, moving by speed, distance limits (because the camera was too slow),
* and also limits the camera within level bounds defined from 0,0 to levelPixelWidth,levelPixelHeight
*
* Disable useSpeed to disable moving by speed, and the camera will instantly move as close to
* the attached gameObject as possible without exceeding the level bounds
using UnityEngine;
using System.Collections;
public class AmbientLight : MonoBehaviour {
//Global Variables for the Ambient Lighting Script
public static AmbientLight curController { get; private set; } // Public getters, private setters
public static int curLightMode { get; private set; }
public static int dayLength { get; private set; }
public static int[] timeList { get; private set; }
using UnityEngine;
public class DatTrueRotateScript : MonoBehaviour {
public Vector3 RotationAngleOffset = new Vector3( 0f, 0f, 90f);
//Setting gun rotation
Vector3 mousePos_world;
Vector3 mousePos;
Vector3 direction;
/* A Basic Orthographic camera script
* To get the correct orthosize, you must import all of your textures as sprites and
* you must ensure that all of your sprites are using the same Pixels Per Unit count
* and you must ensure that the orthoSize in this script is double your Pixels Per Unit
*/
using UnityEngine;
using System.Collections;
public class BaseCameraScript : MonoBehaviour {
public float orthoSize = 32f; // Check your sprite's in the inspector. This should be double the "Pixels Per Unit"