Skip to content

Instantly share code, notes, and snippets.

Kayne Ruse Ratstail91

Block or report user

Report or block Ratstail91

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 render_news_panel.jsx
render() {
return (
<div>
{Object.keys(this.state.data).map((key, index) => <div key={key}><ReactMarkdown source={this.state.data[key]} escapeHTML={false} /><hr /></div> )}
</div>
);
}
@Ratstail91
Ratstail91 / PlayerCharacterController.cs
Created Mar 19, 2019
The Player Controller script stripped to it's core.
View PlayerCharacterController.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCharacterController : MonoBehaviour {
//internal components
Rigidbody2D rigidBody;
BoxCollider2D boxCollider;
//constants
View resource_wars.txt
(C) Kayne Ruse, KR Game Studios 2018
Qty; Card Name; Cost; Points; Card Type; Card Effect;
20 Raw Coal 0 1 coal resource ;
20 Raw Oil 0 1 oil resource ;
20 Raw Gas 0 1 gas resource ;
20 Coal 3 2 coal resource ;
20 Oil 3 2 oil resource ;
20 Gas 3 2 gas resource ;
View example.toy
//TODO: const
//NOTE: No variable hoisting!
// oneline comment
/* multiline comment */
import "standard"; //imports built-in libraries, or .toy files
import "external.toy";
print("hello world\n"); //print is a keyword, rather than a function - useful for debugging
View memoize.py
# fibonacci sequence, memoized
def memoize(func, arg):
if func not in memoize.__dict__:
memoize.__dict__[func] = {}
if arg not in memoize.__dict__[func]:
memoize.__dict__[func][arg] = func(arg)
return memoize.__dict__[func][arg]
View link_button.jsx
View flash_Color.cs
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);
}
View candyraid.conf
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 / {
View arrayexample.cs
Vector3 targetVector = gameObjectArray[waypoint].transform.position;
_navMeshAgent.SetDestination(targetVector);
View CharacterController2D.cs
using System.Collections;
using System.IO;
using UnityEngine;
[System.Serializable]
public class CharacterController2D : MonoBehaviour {
BoxCollider2D hitbox;
Rigidbody2D rigidBody;
public string statisticsFile;
You can’t perform that action at this time.