Skip to content

Instantly share code, notes, and snippets.

@AxGord
Created July 21, 2018 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AxGord/b3ad09016f9aca6af66d3f586aa5bb6d to your computer and use it in GitHub Desktop.
Save AxGord/b3ad09016f9aca6af66d3f586aa5bb6d to your computer and use it in GitHub Desktop.
var w = Config.width;
var h = Config.height;
var space:NapeSpaceView = new NapeSpaceView(new Point<Float>(0, 600));
space.debugLines = {size: 3, color: 0xFFFFFF};
c.addChild(space);
space.createStaticRect(new Rect<Float>(50, h - 50, w - 100, 1));
space.createStaticRect(new Rect<Float>(w - 50, 50, 1, h - 100));
var ball = space.createCircle(50);
ball.core.pos = new Point<Float>(50, h / 2);
ball.core.angularVel = 20 * 4;
ball.core.setSpeed(700);
for (i in 0...16) {
var box = space.createBox(new Point<Float>(16, 32));
box.core.pos = new Point<Float>(w / 2, (h - 100) - 32 * (i + 0.5));
// ball.core.collision(box.core) << function() ball.destroy();
}
space.play();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment