From 7556f676ea51a43393ed5b42f9a4afc894bba8c5 Mon Sep 17 00:00:00 2001
From: Kullberg Joonatan <joonatan.kullberg@gmail.com>
Date: Fri, 10 Jan 2025 11:23:02 +0200
Subject: [PATCH] =?UTF-8?q?pistelaskuri=20ehk=C3=A4=20toimii=20j=C3=A4rkev?=
 =?UTF-8?q?=C3=A4sti?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../Financial_Freedom/Data/toplistsave.txt             |  4 ++--
 .../Financial_Freedom/Financial_Freedom.cs             | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Financial_Freedom/Financial_Freedom/Data/toplistsave.txt b/Financial_Freedom/Financial_Freedom/Data/toplistsave.txt
index 43e6a55..813eb66 100644
--- a/Financial_Freedom/Financial_Freedom/Data/toplistsave.txt
+++ b/Financial_Freedom/Financial_Freedom/Data/toplistsave.txt
@@ -5,10 +5,10 @@
       <Array Type="Jypeli.ScoreItem[], Jypeli, Version=11.3.7.0, Culture=neutral, PublicKeyToken=null">
         <Item Index="0" Type="Jypeli.ScoreItem, Jypeli, Version=11.3.7.0, Culture=neutral, PublicKeyToken=null">
           <Field Name="Name" Type="System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
-            <Value>miku</Value>
+            <Value>Jollu</Value>
           </Field>
           <Field Name="Score" Type="System.Double, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
-            <Value>100000</Value>
+            <Value>6969696969</Value>
           </Field>
         </Item>
         <Item Index="1" Type="Jypeli.ScoreItem, Jypeli, Version=11.3.7.0, Culture=neutral, PublicKeyToken=null">
diff --git a/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs b/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs
index d2e1e18..ae7e7ab 100644
--- a/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs
+++ b/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs
@@ -112,6 +112,7 @@ public class  Financial_Freedom : PhysicsGame
     private bool tavoiteSaavutettu = false;
     private bool peliOhi = false;
     private double tavoiteRaha = 1000000000;
+    private double tempscore;
     private double highScore = 0;
     private double finalscore;
     private bool AloitusRaha = false;
@@ -173,7 +174,7 @@ public class  Financial_Freedom : PhysicsGame
         
         topLista.EnterText = "Onnittelut, olet päässyt kymmenen parhaimman uhkapelaajan joukkoon! Syötä nimesi niin jäät historian kirjoihin.";
         topLista.Text = "Parhaat uhkapelaajat";
-        topLista.HighScoreWindow.Size = new Vector(300,500);
+        topLista.HighScoreWindow.Size = new Vector(300,400);
         topLista.HighScoreWindow.Color = Color.Mint;
         
         LuoAikaLaskuri();
@@ -254,14 +255,15 @@ public class  Financial_Freedom : PhysicsGame
         if (peliKesken == 0)
         {
             if (pistelaskuri == null) return;
-            else if (pistelaskuri.Value > highScore)
+            else if (pistelaskuri.Value > tempscore)
             {
-                highScore = pistelaskuri.Value;
+                highScore += (pistelaskuri.Value-tempscore);
                 Console.WriteLine("uusi highscore: "+highScore);
+                tempscore = pistelaskuri.Value;
             }
             else
             {
-                return;
+                tempscore = pistelaskuri.Value;
             }
         }
         else
-- 
GitLab