diff --git a/Financial_Freedom/Financial_Freedom/Content/RouletteBG.png b/Financial_Freedom/Financial_Freedom/Content/RouletteBG.png new file mode 100644 index 0000000000000000000000000000000000000000..d01cba5d7ab994fda30f4e44c0305e837a498710 Binary files /dev/null and b/Financial_Freedom/Financial_Freedom/Content/RouletteBG.png differ diff --git a/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs b/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs index d4f56dbb7625fc21a376c0cd9bc5e1e2e99d53cd..7fbf9820e369db50a02b4464a06739051144754e 100644 --- a/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs +++ b/Financial_Freedom/Financial_Freedom/Financial_Freedom.cs @@ -289,6 +289,7 @@ public class Financial_Freedom : PhysicsGame Image taustakuvaBJ = LoadImage("taustakuvaBJ.jpg"); Image taustakuvaPlinko = LoadImage("plinkobg.jpg"); Image taustakuvaCF = LoadImage("Coinflipbg.png"); + Image taustakuvaRulet = LoadImage("RouletteBG.png"); Image Icon1 = LoadImage("Plinko.jpg"); Image Icon2 = LoadImage("Blackjack.png"); Image Icon3 = LoadImage("Ruletti.png"); @@ -1350,6 +1351,9 @@ public class Financial_Freedom : PhysicsGame ClearGameObjects(); ClearControls(); + Level.Background.Image = taustakuvaRulet; + Level.Background.Width = Screen.Width; + Level.Background.Height = Screen.Height; Add(pistenaytto); await LisaaPanos(); panosAsetettu.TrySetResult(true); @@ -1373,6 +1377,12 @@ public class Financial_Freedom : PhysicsGame ClearGameObjects(); ClearControls(); + Label ohjeet = new Label(1100, 35, "Klikkaa mihin haluat asettaa panoksesi. Jos klikkaat montaa kohtaa niin panos jaetaan niiden välille tasan."); + ohjeet.Color = Color.SkyBlue; + ohjeet.TextColor = Color.Black; + ohjeet.Position = new Vector(Screen.Right-575, Screen.Top-25); + Add(ohjeet); + // Tausta panostusalueelle GameObject panostusAlue = new GameObject(Screen.Width / 4, Screen.Height / 2, Shape.Rectangle); panostusAlue.Color = Color.DarkGreen; @@ -1391,8 +1401,8 @@ public class Financial_Freedom : PhysicsGame double gridHeight = totalRows * buttonSize + (totalRows - 1) * padding; // Asetetaan gridin aloituskohta panostusalueen sisällä niin, että se on keskitetty - double startX = panostusAlue.Position.X - gridWidth / 2 + buttonSize / 2; - double startY = (panostusAlue.Position.Y + panostusAlue.Height / 2 - gridHeight / 2 - buttonSize / 2)-50; + double startX = (panostusAlue.Position.X - gridWidth / 2 + buttonSize / 2); + double startY = (panostusAlue.Position.Y + panostusAlue.Height / 2 - gridHeight / 2 - buttonSize / 2); //Console.WriteLine($"start x ={startX} ja start y = {startY}"); @@ -1460,13 +1470,13 @@ public class Financial_Freedom : PhysicsGame GameObject gOPanos = new GameObject(150, 50); gOPanos.Color = Color.LimeGreen; // Asetetaan nappi hieman panostusalueen alapuolelle - gOPanos.Position = new Vector(startX+52, startY+55); + gOPanos.Position = new Vector(startX+52, startY+60); Add(gOPanos); Label gOLabel = new Label(150, 50); gOLabel.Text = "0"; gOLabel.TextColor = Color.White; - gOLabel.Position = new Vector(startX+52, startY+55); + gOLabel.Position = new Vector(startX+52, startY+60); gOPanos.Add(gOLabel); Mouse.Listen(MouseButton.Left, ButtonState.Pressed, () => @@ -1486,13 +1496,13 @@ public class Financial_Freedom : PhysicsGame GameObject gO0Panos = new GameObject(150, 50); gO0Panos.Color = Color.LimeGreen; // Asetetaan nappi hieman panostusalueen alapuolelle - gO0Panos.Position = new Vector(startX+220, startY+55); + gO0Panos.Position = new Vector(startX+220, startY+60); Add(gO0Panos); Label gO0Label = new Label(150, 50); gO0Label.Text = "00"; gO0Label.TextColor = Color.White; - gO0Label.Position = new Vector(startX+220, startY+55); + gO0Label.Position = new Vector(startX+220, startY+60); gO0Panos.Add(gO0Label); Mouse.Listen(MouseButton.Left, ButtonState.Pressed, () => @@ -1569,13 +1579,13 @@ public class Financial_Freedom : PhysicsGame GameObject Done = new GameObject(150, 75); Done.Color = Color.Green; // Asetetaan nappi hieman panostusalueen alapuolelle - Done.Position = new Vector(Screen.Right-200,-200); + Done.Position = new Vector(500,-200); Add(Done); Label DoneLabel = new Label(150, 75); DoneLabel.Text = "Valmis"; DoneLabel.TextColor = Color.White; - DoneLabel.Position = new Vector(Screen.Right-200,-200); + DoneLabel.Position = new Vector(500,-200); Done.Add(DoneLabel); Mouse.Listen(MouseButton.Left, ButtonState.Pressed, () => @@ -1608,6 +1618,8 @@ public class Financial_Freedom : PhysicsGame ClearControls(); List<string> Betit = new HashSet<string>(clickLog).ToList(); MessageDisplay.Add($"Panokset on jaettu kohtiin:{string.Join(", ", Betit)}"); + Console.WriteLine($"Panokset on jaettu kohtiin:{string.Join(", ", Betit)}"); + Console.WriteLine($"Panos per kohde on {panos} jaettuna {clickLog.Count} on {panos/clickLog.Count}"); RulettiAnimaatio(); TakaisinPV(); } diff --git a/Financial_Freedom/Financial_Freedom/Financial_Freedom.csproj b/Financial_Freedom/Financial_Freedom/Financial_Freedom.csproj index 6eb89768433436b0dd32475dcef6200b9b7e1a92..be0bc21f222962a431953a7c5e9c0d402a8a2b05 100644 --- a/Financial_Freedom/Financial_Freedom/Financial_Freedom.csproj +++ b/Financial_Freedom/Financial_Freedom/Financial_Freedom.csproj @@ -332,6 +332,9 @@ <None Update="Data\toplistsave.txt"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Update="Content\RouletteBG.png"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> </ItemGroup> <ItemGroup>