- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
class Vector2 { | |
constructor(x, y) { | |
this.x = x || 0; | |
this.y = y || 0; | |
} | |
reset(x, y) { | |
this.x = x; | |
this.y = y; | |
return this; |
##Micro Game Engines And Boilerplates##
http://ox2d.com/
https://github.com/Gozala/selfish
https://github.com/michalbe/mibbu
https://github.com/ooflorent/js13k-boilerplate
##Sound and Music## http://sb.bitsnbites.eu/
Most important detail: in js13k entry 13k stands for zipped entry size. And this detail makes js13k differ from other code golfing compos.
Last year winner entry uncompressed size was about 70k. 70 kilobytes! In js1k you have a month to minify 1k, so how much time would it take to minify 70k? Nope, you have only 1 month. So it's very unlikely one will manually golf the entry. And this is the other thing that makes js13k special: no hardcore manual "hell yeah I've stripped one byte!" golfing.
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available | |
http://www.joelambert.co.uk | |
Copyright 2011, Joe Lambert. | |
Free to use under the MIT license. | |
http://www.opensource.org/licenses/mit-license.php |