Skip to content
Snippets Groups Projects
Commit 7cfe11d5 authored by Yli-Tainio Janne Sakri Juhani's avatar Yli-Tainio Janne Sakri Juhani
Browse files

Pelin lopputeksti

parent 8cd92b91
No related branches found
No related tags found
No related merge requests found
......@@ -8,18 +8,8 @@
</component>
<component name="ChangeListManager">
<list default="true" id="0cb08879-2df4-4f3a-a1a9-8178f387d135" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblinhyppaa.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblinkavelee1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblinkavelee2.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblinkavelee3.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/goblinseisoo1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/kolikkogoblin/content/taustamusikaali.wav" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.kolikkogoblin/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.kolikkogoblin/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/content/goblin1.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/content/goblin2.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/content/goblin3.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.cs" beforeDir="false" afterPath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/kolikkogoblin/kolikkogoblin.csproj" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -113,6 +103,8 @@
<workItem from="1700419527544" duration="1390000" />
<workItem from="1700478161676" duration="1913000" />
<workItem from="1700510066280" duration="2289000" />
<workItem from="1700564843502" duration="800000" />
<workItem from="1700580111009" duration="1786000" />
</task>
<servers />
</component>
......
......@@ -37,6 +37,8 @@ public class Kolikkogoblin : PhysicsGame
};
private static readonly String[] taso1 = {
" ",
" ",
" EP ",
" ",
" M ",
......@@ -79,10 +81,21 @@ public class Kolikkogoblin : PhysicsGame
" X X X XX ",
" WWWWWWW W G W WWWWW",
};
private static readonly String[] pelilapi =
{
" ",
" ",
" ",
" ",
" ",
" ",
" ",
};
private static readonly int TileWidth = 800 / taso0[0].Length;
private static readonly int TileHeight = 480 / taso0.Length;
private static readonly string[][] tasolista = { taso0, taso1, taso2};
private static readonly string[][] tasolista = { taso0, taso1, taso2, pelilapi};
private IntMeter KeratytKolikot;
private IntMeter Elamat;
......@@ -99,10 +112,9 @@ public class Kolikkogoblin : PhysicsGame
{
MultiSelectWindow alkuvalikko = new MultiSelectWindow("Pelin alkuvalikko", "Aloita peli","Lopeta");
Add(alkuvalikko);
alkuvalikko.AddItemHandler(0, AloitaUusiPeli);
alkuvalikko.AddItemHandler(1, Exit);
AloitaUusiPeli();
}
/// <summary>
/// Aloitetaan peli. Aluksi siivotaan kaikki, jotta voidaan aloittaa uusi peli.
......@@ -110,7 +122,6 @@ public class Kolikkogoblin : PhysicsGame
/// </summary>
public void AloitaUusiPeli()
{
// KeratytKolikot = 0;
tasoNr.Value = 0;
UusiTaso();
}
......@@ -120,10 +131,12 @@ public class Kolikkogoblin : PhysicsGame
public void UusiTaso()
{
ClearAll();
if (tasoNr.Value > tasolista.Length)
if (tasoNr.Value == 3)
{
Console.WriteLine("LÄPÄISIT PELIN");
NaytaIlmoitus("Onneksi Olkoon läpäisit kaikki kartat", Color.Yellow);
return;
}
ClearAll();
int index = tasoNr.Value;
string[] tasonKuva = tasolista[index];
Level.Background.Image = taustakuva;
......@@ -407,4 +420,18 @@ public class Kolikkogoblin : PhysicsGame
elamat.BindTo(Elamat);
Add(elamat);
}
/// <summary>
///
/// </summary>
/// <param name="teksti"></param>
/// <param name="vari"></param>
private void NaytaIlmoitus(string teksti, Color vari)
{
Label label = new Label(teksti);
label.Width = 400;
label.Height = 200;
label.Color = vari;
label.BorderColor = Color.Black;
Add(label);
}
}
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