Skip to content

Instantly share code, notes, and snippets.

View jessefreeman's full-sized avatar

Jesse Freeman jessefreeman

View GitHub Profile
@jessefreeman
jessefreeman / CameraFollow.cs
Created March 20, 2015 18:51
Simple Unity 2D Camera
using UnityEngine;
using System.Collections;
public class CameraFollow : MonoBehaviour {
public GameObject target;
public bool lockXAxis;
public bool lockYAxis;
public bool lockZAxis = true;
public bool useBounds = false;
@jessefreeman
jessefreeman / gist:a087ab7e3373da8ed5e1
Last active August 29, 2015 14:08
FlappyJetroid Workshop
var SPEED = 200;
var GRAVITY = 900;
var JET = 420;
var OPENING = 200;
var SPAWN_RATE = 1.25;
var state = {
preload: function(){
this.load.image('wall', '/assets/wall.png');
@jessefreeman
jessefreeman / tracking.js
Created November 18, 2013 16:43
A simple Google Analytics tracking plugin for your Impact games.
ig.module(
'bootstrap.plugins.tracking'
)
.requires(
)
.defines(function () {
Tracking = ig.Class.extend({
debug: true,
init: function (account) {
@jessefreeman
jessefreeman / GruntFile.js
Created August 20, 2013 12:52
Sample build script for Super Falling Zombies.
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-open');
@jessefreeman
jessefreeman / GruntFile.js
Created June 14, 2013 14:56
A quick build script I wrote to generate Win8, WP8 and web builds of my Impact games
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-open');
@jessefreeman
jessefreeman / Geom.js
Created April 10, 2013 03:18
TypeScript output of my Geom classes for PixelVisionJS
// Module
var pxv;
(function (pxv) {
var Point = (function () {
function Point(x, y) {
if (typeof x === "undefined") { x = 0; }
if (typeof y === "undefined") { y = 0; }
this.x = x;
this.y = y;
}
/**
* @random-map.js
* @version: 1.00
* @author: Jesse Freeman
* @date: May 2012
*
* This class creates a "Random Map" button in the weltmeister editor.
* It requires two layers, a collision layer named "collation" and your
* map layer named "main". The generator will automatically create the collision
* tiles.
@jessefreeman
jessefreeman / camera.js
Created March 1, 2013 20:27
A simple camera for ImpactJS. Also allows for a mask overlay for simple lighting effects.
ig.module(
'game.plugins.camera'
)
.requires(
'impact.game',
'impact.image'
)
.defines(function () {
ig.module(
'plugins.texture-atlas'
)
.requires(
'impact.animation',
'impact.image',
'impact.entity'
)
.defines(function () {
"use strict";
/**
* A TextureAtlasFont extends Impact's Font class to allow looking up a font's bitmap from the TexturePacker JSON array
*
* Author: @jessefreeman
*
* Version 0.1 - 2013/02/19
*
* Usage:
* DemoTextureAtlasFont = ig.Game.extend({
* textureImage: new ig.Image('media/font.png'),