Skip to content

Instantly share code, notes, and snippets.

fiskefyren

Block or report user

Report or block fiskefyren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:cfb9325b2fac3f46c9e5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
View gist:a407cd61af66ca6c3e97
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public float hitPoints = 100f;//max health
public float currentHitPoints;
public GameObject destroyFX, lose;
// Use this for initialization
View AI
// https://www.youtube.com/watch?v=UTLApMrHr5I
// https://www.youtube.com/watch?v=188SMf9f6UY <- this one is better?
using UnityEngine;
using System.Collections;
public class EasyAI : MonoBehaviour {
public float fpsTargetDistance;//how far away the player is from the enemy
public float enemyMovementSpeed;//how fast the enemy moves
View PlayerShooting
using UnityEngine;
using System.Collections;
public class PlayerShooting : MonoBehaviour {
public float fireRate;
public float cooldown;//wait amout of time before we can shoot again
//check to see if we're actually firing
public bool isFiring = false;
View gist:0362897928cef2af1b59
using UnityEngine;
using System.Collections;
public class LaserProjectile : MonoBehaviour {
public float speed = 2f; //speed at which the projectile travels in world space
public int damage = 25; //damage dealt to other objects this projectile hits
private Transform thisTransform; //cached transform for this projectile
public Transform lasterHitFXPrefab;
View gist:817bb01f863af7cbed76
using UnityEngine;
using System.Collections;
public class PlayerShooting : MonoBehaviour {
public GameObject shot;
public Transform showSpawn;
public float fireRate;
public float cooldown;
View gist:1ab9c023e79db2cc6060
using UnityEngine;
using System.Collections;
public class EasyAI : MonoBehaviour {
public float fpsTargetDistance; //how far away the player is from the enemy
public float enemyLookDistance; //how close the player needs to be for the enemy to look at the player
public float attackDistance; //how close the player needs to be for the enemy to attack the player
public float enemyMovementSpeed; //how fast the enemy moves
public float turning;
View gist:222211dd58c86b36f0ae
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class EnemyHealth : MonoBehaviour {
public float hitPoints = 100f;//max health
public float currentHitPoints;//current health
public GameObject destroyFX;
public Image healthbar;
View gist:6293ff4b0b116487360a
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class EnemyHealth : MonoBehaviour {
public float hitPoints = 100f;//max health
public float currentHitPoints;//current health
public GameObject destroyFX;//not sure why you use GameObject rather than Transform...
//public GameObject healthbar;
View gist:1f405ddc833bf78fa446
using UnityEngine;
using System.Collections;
public class EnemyHealth : MonoBehaviour {
public float hitPoints = 100f;//max health
public float currentHitPoints;//current health
public GameObject destroyFX;//not sure why you use GameObject rather than Transform...
public GameObject healthbar;
You can’t perform that action at this time.