[gbrainy] Use points instead of percentages for scoring. Also add more information to the finish view



commit aa384bb2f9b9baf4488c919ae4014553da8e6a2f
Author: Jordi Mas <jmas softcatala org>
Date:   Tue Aug 17 16:27:27 2010 +0200

    Use points instead of percentages for scoring. Also add more information to the finish view

 help/C/score.page            |   16 +++++-----------
 src/Core/Main/GameSession.cs |    2 +-
 src/Core/Views/FinishView.cs |   38 +++++++++++++++++++++++++-------------
 3 files changed, 31 insertions(+), 25 deletions(-)
---
diff --git a/help/C/score.page b/help/C/score.page
index 0a9d9c9..0571412 100644
--- a/help/C/score.page
+++ b/help/C/score.page
@@ -67,24 +67,24 @@
   <list>
     <item>
       <p>
-        If you take less than the time expected to complete the game, you score 100%.
+        If you take less than the time expected to complete the game, you score 10 points.
       </p>
     </item>
     <item>
       <p>
-        If you take more than the time expected to complete the game, you score 80%.
+        If you take more than the time expected to complete the game, you score 8 points.
       </p>
     </item>
     <item>
       <p>
         If you take more than 2x the time expected to complete the game,
-        you score 70%.
+        you score 7 points.
       </p>
     </item>
     <item>
       <p>
         If you take more than 3x the time expected to complete the game,
-        you score 60%.
+        you score 6 points.
       </p>
     </item>
     <item>
@@ -96,12 +96,6 @@
   
   <section id="computing-scores">
     <title>Computing the totals</title>
-    <comment>
-      <cite date="2010-04-05" href="mailto:philbull gmail com">Phil Bull</cite>
-      <p>
-      In this section, does "logarithm of 20" mean score = log_20(sum(results))?
-      </p>
-    </comment>
     <p>
       <app>gbrainy</app> keeps track of the different games types played. To compute
       the final score of every set of game types it sums all the results of the 
@@ -111,7 +105,7 @@
     </p>
 	  <p>
 	    This means that when playing at medium difficult level, to get a score of 
-	    100% you need to score 100% on at least 20 games of every game type played.
+	    100 points you need to score 10 points on at least 20 games of every game type played.
 	  </p>
 	  <p>
 	    This may sound challenging, but it allows players to compare game scores from 
diff --git a/src/Core/Main/GameSession.cs b/src/Core/Main/GameSession.cs
index 9069fed..741525d 100644
--- a/src/Core/Main/GameSession.cs
+++ b/src/Core/Main/GameSession.cs
@@ -172,7 +172,7 @@ namespace gbrainy.Core.Main
 					return string.Empty;
 
 				String text;
-				text = String.Format (Catalog.GetString ("Games played: {0} ({1}% score)"), history.GamesPlayed, history.TotalScore);
+				text = String.Format (Catalog.GetString ("Games played: {0} (Score: {1})"), history.GamesPlayed, history.TotalScore);
 				text += String.Format (Catalog.GetString (" - Time: {0}"), current_time);
 
 				if (CurrentGame != null)
diff --git a/src/Core/Views/FinishView.cs b/src/Core/Views/FinishView.cs
index 6df14ad..5a51b05 100644
--- a/src/Core/Views/FinishView.cs
+++ b/src/Core/Views/FinishView.cs
@@ -30,6 +30,7 @@ namespace gbrainy.Core.Views
 	{
 		GameSession session;
 		const int tips_shown = 4;
+		const double smaller_font = 0.018;
 
 		// Caching mechanism to use always the same tips during different redraws of the same view
 		int cached_sessionid;
@@ -57,9 +58,7 @@ namespace gbrainy.Core.Views
 	
 			gr.Rectangle (x, y - h * per, w, h * per);
 			gr.FillGradient (x, y - h * per, w, h * per, new Cairo.Color (0, 0, 1));
-			gr.MoveTo (x, (y - 0.04) - h * per);
-			gr.ShowPangoText (String.Format ("{0}%", percentage));
-			gr.Stroke ();
+			gr.DrawTextCentered (x + w / 2, (y - 0.03) - h * per, String.Format ("{0}", percentage));
 
 			gr.Save ();
 			gr.Color = new Cairo.Color (0, 0, 0);	
@@ -72,14 +71,21 @@ namespace gbrainy.Core.Views
 			gr.Restore ();
 		}
 
-		void DrawGraphicBar (CairoContextEx gr, double x, double y)
+		void DrawColumnBarGraphic (CairoContextEx gr, double x, double y)
 		{
-			const double area_w = 0.9, area_h = 0.28;
+			const double area_w = 0.85, area_h = 0.28;
 			const double bar_w = 0.05, bar_h = area_h - 0.02;
-			const double space_x = 0.09;
+			const double space_x = 0.08;
 		
 			gr.LineWidth = 0.005;
 
+			// Draw X reference values
+			gr.SetPangoFontSize (smaller_font);
+			gr.DrawTextAlignedRight (x + 0.05, y, "100");
+			gr.DrawTextAlignedRight (x + 0.05, y + area_h - 0.02, "0");
+
+			x += 0.06;
+
 			// Axis
 			gr.MoveTo (x, y);
 			gr.LineTo (x, y + area_h);
@@ -150,10 +156,16 @@ namespace gbrainy.Core.Views
 			gr.MoveTo (x, y);
 			gr.ShowPangoText (String.Format (Catalog.GetString ("Time played {0} (average per game {1})"), session.GameTime, session.TimePerGame));
 		
-			y += 0.1;
-			DrawGraphicBar (gr, x, y);
-			y += 0.4;
+			y += 0.09;
+			DrawColumnBarGraphic (gr, x, y);
+
+			y += 0.36;
+			gr.MoveTo (x, y);
+			gr.SetPangoFontSize (smaller_font);
+			gr.ShowPangoText (Catalog.GetString ("For details on how gbrainy's scoring works refer to the help."));
 
+			y += 0.07;
+			gr.SetPangoNormalFontSize ();
 			records	= session.PlayerHistory.GetLastGameRecords ();
 			gr.MoveTo (x, y);
 
@@ -198,25 +210,25 @@ namespace gbrainy.Core.Views
 					switch (records[i].GameType) {
 					case GameTypes.LogicPuzzle:
 						s = String.Format (Catalog.
-							GetString ("By scoring {0}% in logic puzzle games you have established a new personal record. Your previous record was {1}%."),
+							GetString ("By scoring {0} in logic puzzle games you have established a new personal record. Your previous record was {1}."),
 							records[i].NewScore,
 							records[i].PreviousScore);
 						break;
 					case GameTypes.MathTrainer:
 						s = String.Format (Catalog.
-							GetString ("By scoring {0}% in calculation games you have established a new personal record. Your previous record was {1}%."),
+							GetString ("By scoring {0} in calculation games you have established a new personal record. Your previous record was {1}."),
 							records[i].NewScore,
 							records[i].PreviousScore);
 						break;
 					case GameTypes.MemoryTrainer:
 						s = String.Format (Catalog.
-							GetString ("By scoring {0}% in memory games you have established a new personal record. Your previous record was {1}%."),
+							GetString ("By scoring {0} in memory games you have established a new personal record. Your previous record was {1}."),
 							records[i].NewScore,
 							records[i].PreviousScore);
 						break;
 					case GameTypes.VerbalAnalogy:
 						s = String.Format (Catalog.
-							GetString ("By scoring {0}% in verbal analogies you have established a new personal record. Your previous record was {1}%."),
+							GetString ("By scoring {0} in verbal analogies you have established a new personal record. Your previous record was {1}."),
 							records[i].NewScore,
 							records[i].PreviousScore);
 						break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]