Skip to content

Instantly share code, notes, and snippets.

View jackrugile's full-sized avatar

Jack Rugile jackrugile

View GitHub Profile
class Vector2 {
constructor(x, y) {
this.x = x || 0;
this.y = y || 0;
}
reset(x, y) {
this.x = x;
this.y = y;
return this;
@xem
xem / readme.md
Last active April 5, 2024 23:16
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • 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

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

@blueboxes
blueboxes / JS13KGamesResources.md
Last active August 13, 2018 06:53
This is a list of useful links, resources and tutorials for creating an JS13K Games entry. The items are in no particular order. Please feel free to suggest additions or edits to the list.
@subzey
subzey / gist:b18c482922cd17693d65
Last active August 29, 2015 14:06
Few Tricks on Compressing Js13k Entry

Few Tricks on Compressing Js13k Entry

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.

@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
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