Mercurial > projects > openmelee
comparison ships/planet.d @ 24:441eb7672404
impleneted steer to avoid
author | zzzzrrr <mason.green@gmail.com> |
---|---|
date | Fri, 27 Mar 2009 16:05:24 -0400 |
parents | 4fce5596d1f6 |
children |
comparison
equal
deleted
inserted
replaced
23:e79347dd38a3 | 24:441eb7672404 |
---|---|
34 import blaze.bzWorld: bzWorld; | 34 import blaze.bzWorld: bzWorld; |
35 import blaze.dynamics.bzBodyDef; | 35 import blaze.dynamics.bzBodyDef; |
36 import blaze.collision.shapes.bzCircle : bzCircleDef; | 36 import blaze.collision.shapes.bzCircle : bzCircleDef; |
37 import blaze.common.bzMath: bzVec2; | 37 import blaze.common.bzMath: bzVec2; |
38 | 38 |
39 import openmelee.ships.ship: State; | 39 import openmelee.ships.ship: Ship, State; |
40 | 40 |
41 | 41 |
42 class Planet | 42 class Planet : Ship |
43 { | 43 { |
44 bzWorld world; | |
45 bzBody rBody; | |
46 | |
47 this(bzWorld world) { | 44 this(bzWorld world) { |
48 this.world = world; | 45 super(world); |
49 init(); | 46 init(); |
50 auto state = new State; | 47 calcRadius(); |
51 state.radius = rBody.shapeList.sweepRadius; | |
52 rBody.userData = state; | |
53 } | 48 } |
54 | 49 |
55 void init() { | 50 void init() { |
56 // Create planet | 51 // Create planet |
57 bzVec2 position = bzVec2.zeroVect; | 52 bzVec2 position = bzVec2.zeroVect; |