ShadowCaster.js 486 B

123456789101112131415161718192021222324
  1. var game = Atomic.game;
  2. var node = self.node;
  3. var body = node.createComponent("RigidBody2D");
  4. body.bodyType = Atomic.BT_STATIC;
  5. body.castShadows = true;
  6. var circle = node.createComponent("CollisionCircle2D");
  7. circle.radius = .25;
  8. var x = -Light2DExample.halfWidth + (Light2DExample.halfWidth * 2) * Math.random();
  9. var y = -Light2DExample.halfHeight + (Light2DExample.halfHeight * 2) * Math.random();
  10. node.position2D = [x, y];
  11. function start() {
  12. }
  13. function update(timeStep) {
  14. }