diff ships/planet.d @ 22:4fce5596d1f6

ai work
author zzzzrrr <mason.green@gmail.com>
date Thu, 26 Mar 2009 16:56:30 -0400
parents 7f74e064dad5
children 441eb7672404
line wrap: on
line diff
--- a/ships/planet.d	Thu Mar 26 07:02:56 2009 -0400
+++ b/ships/planet.d	Thu Mar 26 16:56:30 2009 -0400
@@ -36,14 +36,20 @@
 import blaze.collision.shapes.bzCircle : bzCircleDef;
 import blaze.common.bzMath: bzVec2;
 
+import openmelee.ships.ship: State;
+
+
 class Planet 
 {
-    
     bzWorld world;
+    bzBody rBody;
     
     this(bzWorld world) {
         this.world = world;
         init();
+        auto state = new State;
+        state.radius = rBody.shapeList.sweepRadius;
+        rBody.userData = state;
     }
     
     void init() {
@@ -51,7 +57,7 @@
         bzVec2 position = bzVec2.zeroVect;
         float angle = 0.0f;
         auto bd = new bzBodyDef(position, angle);
-        auto rBody = world.createBody(bd);
+        rBody = world.createBody(bd);
         float radius = 7.0f;
         float density = 7.5f;
         auto sd = new bzCircleDef(density, radius);