[gnome-games] gnibbles: Make the numboni scale based on the number of players
- From: Jason Clinton <jclinton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnibbles: Make the numboni scale based on the number of players
- Date: Sat, 29 Oct 2011 22:12:33 +0000 (UTC)
commit b05b520f09601186b0ca4757807a0f8eb7006814
Author: Anna SoÅnicka <anna sosnicka gmail com>
Date: Sat Oct 29 17:06:55 2011 -0500
gnibbles: Make the numboni scale based on the number of players
gnibbles/boni.c | 4 ++--
gnibbles/boni.h | 2 +-
gnibbles/worm.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnibbles/boni.c b/gnibbles/boni.c
index 029f6cf..676ab21 100644
--- a/gnibbles/boni.c
+++ b/gnibbles/boni.c
@@ -47,10 +47,10 @@ gnibbles_boni_new (void)
tmp = g_new (GnibblesBoni, 1);
for (i = 0; i < MAXBONUSES; i++)
tmp->bonuses[i] = NULL;
+ tmp->numboni = 8 + properties->numworms;
tmp->numbonuses = 0;
- tmp->numleft = NUMBONI;
+ tmp->numleft = tmp->numboni;
tmp->missed = 0;
-
return tmp;
}
diff --git a/gnibbles/boni.h b/gnibbles/boni.h
index 229c494..63914f9 100644
--- a/gnibbles/boni.h
+++ b/gnibbles/boni.h
@@ -27,10 +27,10 @@
#define MAXBONUSES 100
#define MAXMISSED 2
-#define NUMBONI 10
typedef struct {
GnibblesBonus *bonuses[MAXBONUSES];
+ gint numboni;
gint numbonuses;
gint numleft;
gint missed;
diff --git a/gnibbles/worm.c b/gnibbles/worm.c
index 880f2d6..274be2f 100644
--- a/gnibbles/worm.c
+++ b/gnibbles/worm.c
@@ -302,8 +302,8 @@ gnibbles_worm_grok_bonus (GnibblesWorm *worm)
switch (board->walls[worm->xhead][worm->yhead] - 'A') {
case BONUSREGULAR:
boni->numleft--;
- worm->change += (NUMBONI - boni->numleft) * GROWFACTOR;
- worm->score += (NUMBONI - boni->numleft) * current_level;
+ worm->change += (boni->numboni - boni->numleft) * GROWFACTOR;
+ worm->score += (boni->numboni - boni->numleft) * current_level;
games_sound_play ("gobble");
break;
case BONUSDOUBLE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]