[gnome-nibbles] Apply bonus type HALF based on current length
- From: Iulian Radu <iulianradu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles] Apply bonus type HALF based on current length
- Date: Thu, 3 Mar 2016 20:51:50 +0000 (UTC)
commit 65ec002e0df02cf7416526f242abe3885f39498a
Author: Iulian Radu <iulian radu67 gmail com>
Date: Thu Mar 3 22:38:52 2016 +0200
Apply bonus type HALF based on current length
When reducing the worm's length to half, the total length was actually
the sum of the worm's length and the length that was going to be earned/
lost if the worm previously consumed another bonus.
Reduce the worm's length based on the length shown when the HALF
bonus is consumed.
https://bugzilla.gnome.org/show_bug.cgi?id=762835
src/nibbles-game.vala | 2 +-
src/worm.vala | 5 -----
2 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/src/nibbles-game.vala b/src/nibbles-game.vala
index 4740465..efb6bd1 100644
--- a/src/nibbles-game.vala
+++ b/src/nibbles-game.vala
@@ -440,7 +440,7 @@ public class NibblesGame : Object
if (worm.length + worm.change > 2)
{
worm.score += ((worm.length + worm.change / 2) * current_level);
- worm.reduce_tail (board, (worm.length + worm.change) / 2);
+ worm.reduce_tail (board, worm.length / 2);
worm.change -= (worm.length + worm.change) /2;
}
break;
diff --git a/src/worm.vala b/src/worm.vala
index 5a3e5ab..d8ed0fb 100644
--- a/src/worm.vala
+++ b/src/worm.vala
@@ -201,11 +201,6 @@ public class Worm : Object
{
if (erase_size > 0)
{
- if (length <= erase_size)
- {
- reset (board);
- }
-
for (int i = 0; i < erase_size; i++)
{
board[list.last ().x, list.last ().y] = NibblesGame.EMPTYCHAR;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]