Skip to content

Instantly share code, notes, and snippets.

@anuraghazra
Last active May 16, 2019 17:53
Show Gist options
  • Save anuraghazra/2de1047455896966a83e2e68a4842f7c to your computer and use it in GitHub Desktop.
Save anuraghazra/2de1047455896966a83e2e68a4842f7c to your computer and use it in GitHub Desktop.
let box = new Entity(100);
// x, y, vx, vy added random velocity in first dot to make the box rotate a little bit
box.addDot(100, 100, (Math.random() - 0.5) * 100.0);
box.addDot(200, 100);
box.addDot(200, 200);
box.addDot(100, 200);
box.addStick(0, 1);
box.addStick(1, 2);
box.addStick(2, 3);
box.addStick(3, 0);
box.addStick(3, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment