changed to drawing shells first each frame, before robots

This commit is contained in:
Richard Harrington 2013-08-22 11:04:36 -04:00
parent 9b49d3dd60
commit 5753b593a2

View File

@ -145,12 +145,12 @@
var drawWorld = function(previousWorld, currentWorld) {
ctx.clearRect(0, 0, width, height);
currentWorld.robots.forEach(function(robot, idx) {
drawRobot(robot, ROBOT_COLORS[idx]);
});
currentWorld.shells.forEach(function(shell) {
drawShell(shell);
});
currentWorld.robots.forEach(function(robot, idx) {
drawRobot(robot, ROBOT_COLORS[idx]);
});
if (currentWorld.shells.length > previousWorld.shells.length) {
shotSound.play();
}