Mercurial > projects > openmelee
comparison main.d @ 12:2ecd16840900
added tracker
author | Mason Green <mason.green@gmail.com> |
---|---|
date | Sun, 22 Mar 2009 12:10:16 -0400 |
parents | d998bf1b0654 |
children | e1004697cae1 |
comparison
equal
deleted
inserted
replaced
11:d998bf1b0654 | 12:2ecd16840900 |
---|---|
27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 module openmelee.main; | 31 module openmelee.main; |
32 | |
33 import tango.io.Stdout : Stdout; | |
32 | 34 |
33 version(distrib) import tango.io.vfs.ZipFolder; | 35 version(distrib) import tango.io.vfs.ZipFolder; |
34 import tango.time.StopWatch; | 36 import tango.time.StopWatch; |
35 import fc = tango.text.convert.Float : toString; | 37 import fc = tango.text.convert.Float : toString; |
36 import tango.util.log.Trace; | 38 import tango.util.log.Trace; |
73 gui.immediate.end; | 75 gui.immediate.end; |
74 | 76 |
75 StopWatch timer; | 77 StopWatch timer; |
76 | 78 |
77 jobHub.addRepeatableJob( { | 79 jobHub.addRepeatableJob( { |
80 // Update AI | |
81 ai.move(whut.ship1); | |
78 // Update physics | 82 // Update physics |
79 whut.world.step(timeStep, settings.velocityIterations, | 83 whut.world.step(timeStep, settings.velocityIterations, |
80 settings.positionIterations); | 84 settings.positionIterations); |
81 // Update AI | |
82 | |
83 }, ITERS_PER_SECOND); | 85 }, ITERS_PER_SECOND); |
84 | 86 |
85 bool running = true; | 87 bool running = true; |
86 | 88 |
87 jobHub.addPreFrameJob( { | 89 jobHub.addPreFrameJob( { |
88 bzVec2 velocity = whut.ship1.rBody.linearVelocity; | 90 whut.ship1.updateState(); |
91 whut.ship2.updateState(); | |
89 whut.ship1.limitVelocity(); | 92 whut.ship1.limitVelocity(); |
90 whut.ship2.limitVelocity(); | 93 whut.ship2.limitVelocity(); |
91 }); | 94 }); |
92 | 95 |
93 jobHub.addPostFrameJob( { | 96 jobHub.addPostFrameJob( { |
97 whut.ship2.rBody.angularVelocity = 0.0f; | |
94 gui.begin(cfg); | 98 gui.begin(cfg); |
95 gui.push(`main`); | 99 gui.push(`main`); |
96 if (gui().getProperty!(bool)("frame.closeClicked")) { | 100 if (gui().getProperty!(bool)("frame.closeClicked")) { |
97 running = false; | 101 running = false; |
98 } | 102 } |