Skip to content

Instantly share code, notes, and snippets.

View jonathanhirz's full-sized avatar

Jonathan jonathanhirz

View GitHub Profile
@jonathanhirz
jonathanhirz / timestamp.py
Last active December 28, 2015 13:29
Sublime Text 2 Plugin: Timestamp for creation date and last modified date, automatically added and updated.
"""
Automatically add and update time stamps in your files.
On file open, will replace [timeStamp] with the current date and time.
Currently looks for two instances of this (example below).
To use, place the text [timeStamp] in your template file where you want it.
ex.
// CREATED: timeStamp
// MODIFIED: timeStamp
@jonathanhirz
jonathanhirz / timestamp2.py
Last active January 2, 2016 18:29
Updated timestamp.py for Sublime Text 3. Automatically add (if you have the correct code in your template) and update timestamps to mark the date a file was created and date it was last modified.
"""
Automatically add and update time stamps in your files.
On file open, will replace [timeStamp] with the current date and time.
Currently looks for two instances of this (example below).
To use, place the text [timeStamp] in your template file where you want it.
ex.
// CREATED: timeStamp
// MODIFIED: timeStamp
@jonathanhirz
jonathanhirz / starFieldLuxe1
Last active August 29, 2015 14:07
starFieldLuxe1
var starSprite : Sprite;
var numberOfStars : Int = 300;
@jonathanhirz
jonathanhirz / starFieldLuxe2
Created October 9, 2014 05:29
starFieldLuxe2
override function ready() {
for(i in 0...numberOfStars) {
starSprite = new Sprite({
name : 'star'+i,
size : new Vector(16, 16),
rotation_z : 45.0,
color : new Color().rgb(0xffffff),
pos : new Vector(Std.random(Std.int(Luxe.screen.w)), Std.random(Std.int(Luxe.screen.h)))
}); //starSprite
@jonathanhirz
jonathanhirz / starFieldLuxe3
Last active August 29, 2015 14:07
starFieldLuxe3
import luxe.Component;
import luxe.Sprite;
import luxe.Color;
import luxe.Vector;
import luxe.utils.Maths;
class StarComponent extends Component {
var sprite : Sprite;
@jonathanhirz
jonathanhirz / ColorRollComponent()
Created October 11, 2014 00:42
ColorRollComponent()
import luxe.Component;
import luxe.Sprite;
import luxe.Color;
import luxe.Vector;
import luxe.tween.Actuate;
class ColorRollComponent extends Component {
var sprite : Sprite;
var rad : Float = 0;
@jonathanhirz
jonathanhirz / ColorTweenComponent
Last active August 29, 2015 14:07
ColorTweenComponent()
import luxe.Component;
import luxe.Sprite;
import luxe.Color;
import luxe.Vector;
import luxe.tween.Actuate;
class ColorTweenComponent extends Component {
var sprite : Sprite;
:base {
center-x: screen.center-x;
center-y: screen.center-y;
w: <= screen.w * 0.6;
h: <= screen.h * 0.6;
w: >= 280;
w: <= 500;
h: >= 160;
@jonathanhirz
jonathanhirz / ComponentShip.hx
Created February 28, 2015 23:59
collider stuff
// finally some collision checks!!
var shipHitResults : Array<CollisionData> = Collision.testShapes(shipCollider, StateGamePlay.asteroidColliderPool);
if(shipHitResults.length > 0) {
shipHitCount++;
trace("ship hit " + shipHitCount);
}
var flameHitResults : Array<CollisionData> = Collision.testShapes(engineDamageFlameCollider, StateGamePlay.asteroidColliderPool);
if(flameHitResults.length > 0) {
for(hit in flameHitResults) {
for(asteroid in StateGamePlay.asteroidPool) {
@jonathanhirz
jonathanhirz / ComponentShip.hx
Created March 1, 2015 00:11
collider fixed!
var flameHitResults : Array<CollisionData> = Collision.testShapes(engineDamageFlameCollider, StateGamePlay.asteroidColliderPool);
if(flameHitResults.length > 0) {
for(hit in flameHitResults) {
for(asteroid in StateGamePlay.asteroidPool) {
if(hit.shape2.name == asteroid.name) {
asteroid.destroy();
asteroid = null;
StateGamePlay.asteroidColliderPool.splice(StateGamePlay.asteroidColliderPool.indexOf(hit.shape2), 1);
hit.shape2.destroy();
}