Usage:
var player = new Rect(0, 0, 100, 100);
var target = new Rect(50, 50, 100, 100);
player.is = new AABB(player);
player.is.inside(target);
player.is.colliding(target);
player.is.containing(target);| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2013 Yannick Albert <http://yckart.com> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
Usage:
var player = new Rect(0, 0, 100, 100);
var target = new Rect(50, 50, 100, 100);
player.is = new AABB(player);
player.is.inside(target);
player.is.colliding(target);
player.is.containing(target);| /*! | |
| * jquery.addrule.js 0.0.2 - https://gist.github.com/yckart/5563717/ | |
| * Add css-rules to an existing stylesheet. | |
| * | |
| * @see http://stackoverflow.com/a/16507264/1250044 | |
| * | |
| * Copyright (c) 2013 Yannick Albert (http://yckart.com) | |
| * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). | |
| * 2013/11/23 | |
| **/ |
| // http://kenany.me/blog/base64-js/ | |
| var utf8 = { | |
| encode: function(str) { return unescape( encodeURIComponent(str) ); }, | |
| decode: function(str) { return decodeURIComponent( escape(str) ); } | |
| }; |
| /** | |
| * Hide the addressbar on ios & android devices | |
| * https://gist.github.com/yckart/5609969 | |
| * | |
| * Based on the work from Nate Smith | |
| * @see https://gist.github.com/nateps/1172490 | |
| * | |
| * Copyright (c) 2013 Yannick Albert (http://yckart.com) | |
| * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). | |
| * 2013/07/10 |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2013 Yannick Albert <http://yckart.com> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
The usage is quite simple, just add a new listender to the node you want to observe and manipulate the classes as usually:
var $node = $('div')
// listen to class-manipulations
.on('addClass toggleClass removeClass', function (e, oldClass, newClass) {
console.log('Changed from %s to %s due %s', oldClass, newClass, e.type);
})| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2013 Yannick Albert <http://yckart.com> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2013 Yannick Albert <http://yckart.com> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |