Skip to content

Instantly share code, notes, and snippets.

@leegrey
leegrey / SeededRandomNumberGenerator.js
Created August 3, 2012 13:32
Seeded random in Javascript, translated from Michael Baczynski's AS2 ( http://www.polygonal.de )
/*
* Copyright (c) 2009 Michael Baczynski, http://www.polygonal.de
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@leegrey
leegrey / TileWorld.as
Created November 11, 2011 10:15
TileWorld - Ray Casting in a Grid
// TileWorld.as - Lee Grey, November 2011
package com.lgrey.game.tileEngine
{
import com.lgrey.vectors.LGVector2D;
import flash.display.BitmapData;
public class TileWorld
{
protected var _worldMap:BitmapData;
@leegrey
leegrey / Vector2D.as
Created June 22, 2011 08:43
LGVector2D.as - A 2D Vector Class in AS3
//CLASS: com.lgrey.vectors.LGVector2D
//created by Lee Grey
package com.lgrey.vectors {
import flash.geom.Point;
public class LGVector2D {
public var x:Number = 0;
public var y:Number = 0;
@leegrey
leegrey / LGVector2D.cpp
Created June 11, 2011 12:34
LGVector2D - A 2D Vector Class in C++
/*
* LGVector2D.cpp
*
* Created by Lee Grey on 11/06/11.
* Copyright 2011 Lee Grey. All rights reserved.
*
*/
#include "LGVector2D.h"
#include <iostream>