This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
// RasterLineIterator.cs | |
// 3 November 2013 | |
// Author: Brian MacIntosh | |
/// <summary> | |
/// A simple two-dimensional vector. Replace with any 2d vector class. | |
/// </summary> | |
class Vector2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Helper fn | |
int pgcdr(int a, int b) | |
{ | |
if (a) return pgcdr(b % a, a); | |
else return b; | |
} | |
//Recursive gcd fn | |
int gcdr(int a, int b) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Collections.Generic; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
private static int answer; | |
private static int iterations = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//sample code showing how to create a contact listener with | |
//kripken's Javascript port of Box2D.js | |
//https://github.com/kripken/box2d.js/ | |
var gravity = new Box2D.b2Vec2(0.0, 10.0); | |
var world = new Box2D.b2World(gravity); | |
var contactListener = new Box2D.JSContactListener(); | |
contactListener.BeginContact = function(contact) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
AngleDegrees angleA = new AngleDegrees(90); | |
AngleRadians angleB = new AngleRadians(Math.PI / 2); | |
// angleA will be implicitly converted to AngleRadians because that's what the method parameter is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Devices.Sensors; | |
/* | |
* XNA Windows Phone Easy Accelerometer Access | |
* by Brian MacIntosh for ThunderFish Entertainment/BoneFish Studios | |
* | |
* Version: 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using Microsoft.Xna.Framework.Audio; | |
/* | |
* XNA Windows Phone Easy Microphone Access | |
* by Brian MacIntosh for ThunderFish Entertainment/BoneFish Studios | |
* | |
* Version: 1.1 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Graphics; | |
/* | |
* XNA Lightweight Sprite Animation | |
* by Brian MacIntosh for ThunderFish Entertainment/BoneFish Studios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | |
// Modified to add gradient color by Brian MacIntosh | |
Shader "UI/Gradient" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {} | |
_TopLeftColor("Gradient Top Left", Color) = (1,1,1,1) | |
_TopRightColor("Gradient Top Right", Color) = (1,1,1,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
// Author: Brian MacIntosh (The Periodic Group) | |
// MIT License | |
/// <summary> | |
/// Base class that can be extended to quickly create a property drawer for a structure containing | |
/// data like "quantity" of "thing". | |
/// </summary> |
OlderNewer