Skip to content

Commit

Permalink
Start dropping missiles when there's already 150 or more on screen
Browse files Browse the repository at this point in the history
Browsers can't keep up beyond this. I'm betting beyond this point, people will
prefer to lose out on some of the accuracy rather than have the game crawl to a
halt and crank their CPU fan.
  • Loading branch information
henrycatalinismith committed Aug 27, 2014
1 parent ba4c24f commit 98f7475
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/controller/detonation.js
Expand Up @@ -21,6 +21,7 @@ GlobalThermonuclearWar.Controller.Detonation = Marionette.Controller.extend({
latitude: missile.get('target')[0],
longitude: missile.get('target')[1]
});
this.missiles.remove(missile);
},

showExplosion: function(explosion) {
Expand Down
4 changes: 3 additions & 1 deletion src/controller/multiplayer.js
Expand Up @@ -35,7 +35,9 @@ GlobalThermonuclearWar.Controller.Multiplayer = Marionette.Controller.extend({
},

receiveMissile: function(rawMissileData) {
this.missiles.push(new GlobalThermonuclearWar.Model.Missile(rawMissileData));
if (this.missiles.length < 150 ) {
this.missiles.push(new GlobalThermonuclearWar.Model.Missile(rawMissileData));
}
},

registerLocation: function(player) {
Expand Down

0 comments on commit 98f7475

Please sign in to comment.