Skip to content

Instantly share code, notes, and snippets.

View teddykishi's full-sized avatar
💭
I may be slow to respond.

Teddy Kishi teddykishi

💭
I may be slow to respond.
View GitHub Profile
@teddykishi
teddykishi / Tools.js
Last active March 12, 2018 16:08
Somme useful js tools
/*****************
ANIMATION
*****************/
// tiny helper for jquery to know when an css animation/transition ends
// $(".cls").on(animationEnd, fn);
var animationEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend";
// $(".cls").on(transitionEnd, fn);
var transitionEnd = "webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend";
/****************
RANDOM

THE CONFETTI ANIMATION

Smooth, sleek, responsive and retina ready confetti animation effect. There are two types of confetti, the traditional pieces of ‘paper’ and a ribbon type that wiggles its way down the screen. The ribbon confetti uses a physics simulation for the motion while the paper confetti is animated using sine functions.

A Pen by Hemn Chawroka on CodePen.

License.

Phaser Jump Game

This is a demo that goes along with a forum reply here: http://www.html5gamedevs.com/topic/7369-infinite-world/

Working with a potentially infinite world size can be tricky with Phaser. This method seems to work well though. As you move up, the camera follows the hero. Then, based on how high the hero has reached in comparison to where they started, that offset and height is modified on the world bounds. This allows the world to expand to the exact height that the game requires, all the while using the built in physics system without any trickery for the platforms to work. The player is moving up in world space, while the platforms keep their same coordinates, so it is easier to wrap your head around.

A Pen by Jack Rugile on CodePen.

License.

@teddykishi
teddykishi / Olives – a Phaser FruitNinja test.markdown
Created April 18, 2016 14:08
Olives – a Phaser FruitNinja test
@teddykishi
teddykishi / Phaser Coding Tips 3 (Platforms).markdown
Created April 18, 2016 14:07
Phaser Coding Tips 3 (Platforms)
@teddykishi
teddykishi / Drag and Drop in Phaser.markdown
Created April 18, 2016 14:07
Drag and Drop in Phaser
@teddykishi
teddykishi / ex1-prototype-style.js
Created March 8, 2016 23:42 — forked from getify/ex1-prototype-style.js
OLOO (objects linked to other objects) pattern explored (with comparison to the prototype style of the same code)
function Foo(who) {
this.me = who;
}
Foo.prototype.identify = function() {
return "I am " + this.me;
};
function Bar(who) {
Foo.call(this,"Bar:" + who);
var str = "", i = 10000; while(i){ str += Math.random() > .5 ? "1" : "0"; i--; }; str