Skip to content

Instantly share code, notes, and snippets.

View Ratstail91's full-sized avatar
💭
Back in my day, we didn't need no AI.

Kayne Ruse Ratstail91

💭
Back in my day, we didn't need no AI.
View GitHub Profile
//This isn't really possible with templates, and even without templates it needs refactoring every time you want to add something new.
#include <functional>
#include <iostream>
#include <string>
 
class Switcher {
public:
Switcher(std::string s);
Switcher(int i);
@Ratstail91
Ratstail91 / GameController.cs
Last active June 12, 2018 07:25
My new chunk pager system. Still incomplete, but awesome.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
[RequireComponent(typeof(MapEtcher))]
public class GameController : MonoBehaviour {
public Tilemap tilemap; //set by the user
MapGenerator mapGenerator = new MapGenerator();
MapEtcher mapEtcher;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Ducci {
static class DucciSolver {
///<summary>
///The entry point of the program
///</summary>
static void Main(string[] args) {
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Blowsnower : MonoBehaviour {
//structures
public enum Behaviour {
IDLE, WANDER, ATTACK, MELTED
}
@Ratstail91
Ratstail91 / Monster.cs
Last active July 1, 2018 10:18
Reimplemented the corn monster using state machines; the goal is to have a usable state machine, not to redo the corn. This won't compile because of reasons I can't be assed to figure out.
using UnityEngine;
using States;
class Monster : MonoBehaviour {
//AI states
public UnityStateMachine<Monster> stateMachine;
//components
public Animator animator;
public Rigidbody2D rigidBody;
using System.Collections;
using System.IO;
using UnityEngine;
[System.Serializable]
public class CharacterController2D : MonoBehaviour {
BoxCollider2D hitbox;
Rigidbody2D rigidBody;
public string statisticsFile;
Vector3 targetVector = gameObjectArray[waypoint].transform.position;
_navMeshAgent.SetDestination(targetVector);
server {
root /var/www/candyraid/public_html; #your files go here
index index.html index.htm;
server_name localhost candyraid.com www.candyraid.com ""; #your domain name goes here
access_log /var/www/candyraid/logs/access.log; #make sure this file exists first!
error_log /var/www/candyraid/logs/errors.log; #make sure this file exists first!
location / {
void FlashColor(float r, float g, float b, float delay) {
StartCoroutine(FlashColorInternal(r, g, b, delay));
}
IEnumerator FlashColorInternal(float r, float g, float b, float delay) {
spriteRenderer.color = new Color(r, g, b);
yield return new WaitForSeconds(delay);
spriteRenderer.color = new Color(1, 1, 1);
}