Commit e220cfa5 authored by Hubert Denkmair's avatar Hubert Denkmair
Browse files

fix food decay?

parent 1da85e01
......@@ -96,13 +96,15 @@ GameVisualization.prototype.HandleTickMessage = function(frame_id)
this.snakes[snake_id].AnimateEat();
}
this.foodMap.IterateRow(this.nextFoodDecayRow++, function(food) {
food.Decay(32);
}, this);
this.foodMap.IterateRow(this.nextFoodDecayRow++, function(food) {
food.Decay(32);
}, this);
this.nextFoodDecayRow %= 64;
this.nextFoodDecayRow = (this.nextFoodDecayRow + 1) % 64;
if ((this.nextFoodDecayRow % 8) == 0)
{
for (let food_id in this.foodItems)
{
this.foodItems[food_id].Decay(8);
}
}
if (this.nextFoodDecayRow == 0)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment