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 UnityEngine; | |
using System.Collections; | |
// Force inject a sprite renderer before initialization (if not present) | |
[RequireComponent(typeof(SpriteRenderer))] | |
// @TODO Warning, does not take into account parallaxed weight, needs to be added manually | |
// @NOTE Must have a parent container | |
public class TilerChild : MonoBehaviour { | |
public bool repeatX = false; |
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 UnityEngine; | |
using System.Collections; | |
// Must be applied to an empty object wrapping a sprite image | |
public class Tiler : MonoBehaviour { | |
Hashtable tileCollection = new Hashtable(); // X and Y coordinates formatted as x0y0 relative to the starting tile | |
GameObject originTile; | |
public bool repeatX = true; | |
public bool repeatY = false; |
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 UnityEngine; | |
using System.Collections; | |
// @TODO While this is great for debug purposes, all of this data should be loaded a level higher in the actual game | |
public class SceneLoader : MonoBehaviour { | |
GameObject map; | |
void Awake () { | |
// Check if the MapData prefab already exists from DontDestroyOnLoad | |
// If it does keep on going, if it doesn't create a new one |
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 UnityEngine; | |
using System.Collections; | |
public class PlayerHealth : MonoBehaviour { | |
Vector2 pos = new Vector2(10, 10); | |
Vector2 size = new Vector2(200, 16); | |
float barFill = 0.8f; | |
string barText = "Health"; |
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
ig.module( | |
'plugins.tween' | |
).requires( | |
'impact.entity' | |
).defines( function() { | |
'use strict'; | |
var _easing = { | |
linear: { | |
easeNone: function (k) { |
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
/** | |
* Weltmeister - Multiple entity select and move | |
* @author Ash Blue (Twitter @ashbluewd) | |
* @src https://gist.github.com/ashblue/9901165 | |
* | |
* Allows you to select and move multiple entities in Weltmeister with a single command | |
* | |
* Quick usage instructions | |
* - Select the entity layer | |
* - Hold down shift |
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
/** | |
* Detect overlap between two square objects | |
* @param square1 {object} x, y, width, height | |
* @param square2 {object} x, y, width, height | |
* @returns {boolean} | |
*/ | |
function getOverlap(square1, square2) { | |
return square1.x < square2.x + square2.width && | |
square1.x + square1.width > square2.x && | |
square1.y < square2.y + square2.height && |
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
ig.module( | |
'game.entities.particle-generator' | |
) | |
.requires( | |
'impact.entity' | |
) | |
.defines(function(){ | |
'use strict'; | |
// @TODO Must use pooling for individual particles |
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
/** | |
Targets small screen sizes and below, hides CSS from all other sizes | |
@example | |
@include screen-small { | |
#main { | |
width: auto; | |
background: #000; | |
} | |
} |