From bb75ab1a9c506b3c06e9a6725e91b8a2bbc88446 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Wed, 21 Mar 2018 14:07:35 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 111 bytes modified --- 21g30t1e75.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/21g30t1e75.js b/21g30t1e75.js index 1768e6f..bf42a47 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -243,6 +243,12 @@ GameLib.CustomCode.prototype.createFood = function(delta) { } ) + if (this.food.length >= GameLib.CustomCode.MAX_FOOD_ITEMS) { + this.food.shift(); + } + + this.rebuildGrid(); + }.bind(this);