Skip to content
Snippets Groups Projects
Commit 291e7105 authored by Lehtinen Anni Henriikka's avatar Lehtinen Anni Henriikka
Browse files

Kiekon lisääminen kentälle satunnaiseen paikkaan lisätty

parent c536573a
No related branches found
No related tags found
No related merge requests found
Escape/Escape/Content/Barkov.png

564 B | W: | H:

Escape/Escape/Content/Barkov.png

1.13 KiB | W: | H:

Escape/Escape/Content/Barkov.png
Escape/Escape/Content/Barkov.png
Escape/Escape/Content/Barkov.png
Escape/Escape/Content/Barkov.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -8,7 +8,7 @@ using Jypeli.Widgets;
namespace Escape;
/// @author annilehtinen
/// @version 28.03.2025
/// @version 28.03.2025 / 2
/// <summary>
/// Peli, jossa pelaajaan tavoitteena on vältellä vastustajaa (Barkov) ja kerätä kiekkoja saadakseen pisteitä.
/// </summary>
......@@ -32,7 +32,11 @@ public class Escape : PhysicsGame
barkov.Image = LoadImage("Barkov.png");
barkov.X = 60;
barkov.Y = -60;
this.Add(barkov);
this.Add(barkov);
SpawnPuck();
Timer.CreateAndStart(4.0, SpawnPuck);
/// <summary>
/// Peliohjainten asettaminen
/// </summary>
......@@ -64,5 +68,15 @@ public class Escape : PhysicsGame
{
player.Angle += Angle.FromDegrees(angle);
}
void SpawnPuck()
{
GameObject puck = new GameObject(18, 18);
puck.Shape = Shape.Circle;
puck.Color = Color.Black;
puck.LifetimeLeft = TimeSpan.FromSeconds(5.0);
puck.Position = Level.GetRandomPosition();
this.Add(puck);
}
}
}
\ No newline at end of file
......@@ -35,6 +35,12 @@
<None Update="Content\player_move1 kopio.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\puck.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Content\puck3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
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