comparison melee/melee.d @ 23:e79347dd38a3

steering
author zzzzrrr <mason.green@gmail.com>
date Thu, 26 Mar 2009 20:35:58 -0400
parents 4fce5596d1f6
children 441eb7672404
comparison
equal deleted inserted replaced
22:4fce5596d1f6 23:e79347dd38a3
129 initWorld(); 129 initWorld();
130 running = true; 130 running = true;
131 131
132 draw = new Render(world, ship1, ship2, settings); 132 draw = new Render(world, ship1, ship2, settings);
133 human = new Human(ship1); 133 human = new Human(ship1);
134 ai = new AI(ship1, world); 134 ai = new AI(ship2, world);
135 135
136 gui.begin(cfg).retained; 136 gui.begin(cfg).retained;
137 gui.push(`main`); 137 gui.push(`main`);
138 GLViewport(`glview`).renderingHandler(&draw.draw) 138 GLViewport(`glview`).renderingHandler(&draw.draw)
139 .addHandler(&human.onClick) 139 .addHandler(&human.onClick)
151 world.step(timeStep, settings.velocityIterations, settings.positionIterations); 151 world.step(timeStep, settings.velocityIterations, settings.positionIterations);
152 }, ITERS_PER_SECOND); 152 }, ITERS_PER_SECOND);
153 153
154 jobHub.addPreFrameJob( { 154 jobHub.addPreFrameJob( {
155 // Update AI 155 // Update AI
156 ai.move(ship2); 156 ai.move(ship1);
157 }); 157 });
158 158
159 jobHub.addPostFrameJob( { 159 jobHub.addPostFrameJob( {
160 160
161 // Limit velocity 161 // Limit velocity