Skip to content
Snippets Groups Projects
Commit 7556f676 authored by Kullberg Joonatan's avatar Kullberg Joonatan
Browse files

pistelaskuri ehkä toimii järkevästi

parent cf1ae870
No related branches found
No related tags found
No related merge requests found
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<Array Type="Jypeli.ScoreItem[], Jypeli, Version=11.3.7.0, Culture=neutral, PublicKeyToken=null"> <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"> <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"> <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>
<Field Name="Score" Type="System.Double, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"> <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> </Field>
</Item> </Item>
<Item Index="1" Type="Jypeli.ScoreItem, Jypeli, Version=11.3.7.0, Culture=neutral, PublicKeyToken=null"> <Item Index="1" Type="Jypeli.ScoreItem, Jypeli, Version=11.3.7.0, Culture=neutral, PublicKeyToken=null">
......
...@@ -112,6 +112,7 @@ public class Financial_Freedom : PhysicsGame ...@@ -112,6 +112,7 @@ public class Financial_Freedom : PhysicsGame
private bool tavoiteSaavutettu = false; private bool tavoiteSaavutettu = false;
private bool peliOhi = false; private bool peliOhi = false;
private double tavoiteRaha = 1000000000; private double tavoiteRaha = 1000000000;
private double tempscore;
private double highScore = 0; private double highScore = 0;
private double finalscore; private double finalscore;
private bool AloitusRaha = false; private bool AloitusRaha = false;
...@@ -173,7 +174,7 @@ public class Financial_Freedom : PhysicsGame ...@@ -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.EnterText = "Onnittelut, olet päässyt kymmenen parhaimman uhkapelaajan joukkoon! Syötä nimesi niin jäät historian kirjoihin.";
topLista.Text = "Parhaat uhkapelaajat"; topLista.Text = "Parhaat uhkapelaajat";
topLista.HighScoreWindow.Size = new Vector(300,500); topLista.HighScoreWindow.Size = new Vector(300,400);
topLista.HighScoreWindow.Color = Color.Mint; topLista.HighScoreWindow.Color = Color.Mint;
LuoAikaLaskuri(); LuoAikaLaskuri();
...@@ -254,14 +255,15 @@ public class Financial_Freedom : PhysicsGame ...@@ -254,14 +255,15 @@ public class Financial_Freedom : PhysicsGame
if (peliKesken == 0) if (peliKesken == 0)
{ {
if (pistelaskuri == null) return; 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); Console.WriteLine("uusi highscore: "+highScore);
tempscore = pistelaskuri.Value;
} }
else else
{ {
return; tempscore = pistelaskuri.Value;
} }
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment