Skip to content

Instantly share code, notes, and snippets.

@jorio
jorio / Shake.js
Last active November 30, 2016 15:53
custom Shake implementation for Phaser 2 (transpiled from Shake.ts)
"use strict";
var Shake = (function () {
function Shake(game) {
this.game = game;
}
/**
* @param {number} amp amplitude in pixels
* @param {number} duration
* @param {boolean} x shake on X axis
@jorio
jorio / Shake.ts
Last active November 29, 2016 10:33
custom Shake implementation for Phaser 2
export class Shake {
game: Phaser.Game;
x: boolean;
y: boolean;
xoff: number;
yoff: number;
amp: number;
tween: Phaser.Tween;
constructor(game: Phaser.Game) {