Skip to content
Snippets Groups Projects
Commit 16cb1f7f authored by Saksi Kerttu's avatar Saksi Kerttu
Browse files

grafiikoita lisätty hillerit liikkuu ja kolme kenttää luotu

parent b8c20e0a
No related branches found
No related tags found
No related merge requests found
......@@ -97,13 +97,13 @@ namespace Sammakkopeli
switch (valinta)
{
case 0:
AlustaKentta();
AlustaKentta("Kentta1");
break;
case 1:
AlustaKentta();
AlustaKentta("Kentta2");
break;
case 2:
AlustaKentta();
AlustaKentta("Kentta3");
break;
case 3:
TeeAlkuValikko();
......@@ -171,22 +171,32 @@ namespace Sammakkopeli
/// <summary>
/// Luo peliin kentn ja alustaa pelin
/// </summary>
void AlustaKentta()
void AlustaKentta(string kenttakartta)
{
Level.BackgroundColor = Color.Aqua;
ColorTileMap ruudut = ColorTileMap.FromLevelAsset("Kentta1");
GameObject taustakuva = new GameObject(2016, 1440);
taustakuva.Image = LoadImage("Tausta");
Add(taustakuva, -3);
Layers[-3].RelativeTransition = new Vector(0.5, 0.5);
ColorTileMap ruudut = ColorTileMap.FromLevelAsset(kenttakartta);
ruudut.SetTileMethod(Color.Gold, LuoTaso);
ruudut.SetTileMethod(Color.Red, LuoPelihahmo);
ruudut.SetTileMethod(Color.Orange, LuoHilleri);
ruudut.SetTileMethod(Color.Black, LuoKarpanen);
ruudut.SetTileMethod(Color.Purple, LuoMutaRuoho);
ruudut.Optimize(Color.Purple);
ruudut.Optimize(Color.Gold);
ruudut.Execute(40, 40);
Level.CreateBorders();
Camera.Zoom(1.5);
Camera.Follow(sammakko);
LuoAjastimet();
LuoLaskurit();
AsetaMuuttujat();
......@@ -386,12 +396,22 @@ namespace Sammakkopeli
PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus);
taso.Position = paikka;
taso.Shape = Shape.Rectangle;
taso.Color = Color.Orange;
taso.Color = Color.DarkAzure;
taso.Image = LoadImage("Muta.png");
taso.CollisionIgnoreGroup = 1;
taso.Tag = "palikka";
Add(taso);
}
void LuoMutaRuoho(Vector paikka, double leveys, double korkeus)
{
PhysicsObject mutaruoho = PhysicsObject.CreateStaticObject(leveys, korkeus);
mutaruoho.Position = paikka;
mutaruoho.Shape = Shape.Rectangle;
mutaruoho.Image = LoadImage("Mutaruoho");
Add(mutaruoho);
}
/// <summary>
/// Luo peliin vihollisen
......@@ -401,11 +421,19 @@ namespace Sammakkopeli
/// <param name="korkeus">vihollisen korkeus</param>
void LuoHilleri(Vector paikka, double leveys, double korkeus)
{
PhysicsObject hilleri = new PhysicsObject(100, 70);
PlatformCharacter hilleri = new PlatformCharacter(98, 70);
hilleri.IgnoresCollisionResponse = true;
hilleri.Position = paikka;
hilleri.Image = LoadImage("Hilleri.png");
hilleri.MirrorImage();
Add(hilleri);
PlatformWandererBrain hilleriAivot = new PlatformWandererBrain();
hilleriAivot.Speed = 75;
hilleri.Brain = hilleriAivot;
}
......@@ -417,7 +445,7 @@ namespace Sammakkopeli
/// <param name="korkeus"></param>
void LuoKarpanen(Vector paikka, double leveys, double korkeus)
{
PhysicsObject karpanen = PhysicsObject.CreateStaticObject(leveys, korkeus);
PhysicsObject karpanen = PhysicsObject.CreateStaticObject(leveys, 45);
karpanen.Position = paikka;
karpanen.Image = LoadImage("Karpane.png");
karpanen.IgnoresCollisionResponse = true;
......
......@@ -22,9 +22,24 @@
<None Update="content\Kentta1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\Kentta2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\Kentta3.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\Muta.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\Mutaruoho.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\Sammakko.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="content\Tausta.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
......
Sammakkopeli/Sammakkopeli/content/Kentta1.png

824 B | W: | H:

Sammakkopeli/Sammakkopeli/content/Kentta1.png

889 B | W: | H:

Sammakkopeli/Sammakkopeli/content/Kentta1.png
Sammakkopeli/Sammakkopeli/content/Kentta1.png
Sammakkopeli/Sammakkopeli/content/Kentta1.png
Sammakkopeli/Sammakkopeli/content/Kentta1.png
  • 2-up
  • Swipe
  • Onion skin
Sammakkopeli/Sammakkopeli/content/Kentta2.png

872 B

Sammakkopeli/Sammakkopeli/content/Kentta3.png

862 B

Sammakkopeli/Sammakkopeli/content/Muta.png

1.77 KiB

Sammakkopeli/Sammakkopeli/content/Mutaruoho.png

2.17 KiB

Sammakkopeli/Sammakkopeli/content/Tausta.png

262 KiB

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