diff --git a/.DS_Store b/.DS_Store index 7219aad78a7e256f8b4aded2830a7d7f32e746a0..227191810270156f50386a54923eaf85dc57a92b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/peli/.DS_Store b/peli/.DS_Store index 38d0ab4932cd18205078178068bb302fd19b69f6..9e1da1fff89bcff305ad7dfb7726ec440612bb53 100644 Binary files a/peli/.DS_Store and b/peli/.DS_Store differ diff --git "a/peli/harkkaty\303\266/.DS_Store" "b/peli/harkkaty\303\266/.DS_Store" index e21f313a95b09d13f12406cd3e1353fd88b77fd7..733ca3084c92cdd07728ddce2198ee1e31d814df 100644 Binary files "a/peli/harkkaty\303\266/.DS_Store" and "b/peli/harkkaty\303\266/.DS_Store" differ diff --git "a/peli/harkkaty\303\266/pomppu possu/.DS_Store" "b/peli/harkkaty\303\266/pomppu possu/.DS_Store" new file mode 100644 index 0000000000000000000000000000000000000000..d3b480229c503d0d8c51c5747e7ac9bdfebdb0ab Binary files /dev/null and "b/peli/harkkaty\303\266/pomppu possu/.DS_Store" differ diff --git "a/peli/harkkaty\303\266/pomppu possu/Content/.DS_Store" "b/peli/harkkaty\303\266/pomppu possu/Content/.DS_Store" new file mode 100644 index 0000000000000000000000000000000000000000..4340cd62ed74e029199194a0b6f7b793b211494d Binary files /dev/null and "b/peli/harkkaty\303\266/pomppu possu/Content/.DS_Store" differ diff --git "a/peli/harkkaty\303\266/pomppu possu/Content/kentta1.txt" "b/peli/harkkaty\303\266/pomppu possu/Content/kentta1.txt" new file mode 100644 index 0000000000000000000000000000000000000000..c8be7dd6c19f78896070fed66c8382b82a9423ee --- /dev/null +++ "b/peli/harkkaty\303\266/pomppu possu/Content/kentta1.txt" @@ -0,0 +1,17 @@ + * + ## + + * * + ## ## + + * * + ## ## ## + + * * * * + ## ## ## ## + + * * * * + ## ## ## ## ## + + N +###################### diff --git "a/peli/harkkaty\303\266/pomppu possu/Content/maali.wav" "b/peli/harkkaty\303\266/pomppu possu/Content/maali.wav" new file mode 100644 index 0000000000000000000000000000000000000000..d59487214e456fc654096d0f3284661051590b3d Binary files /dev/null and "b/peli/harkkaty\303\266/pomppu possu/Content/maali.wav" differ diff --git a/pomppupossu.png "b/peli/harkkaty\303\266/pomppu possu/Content/pomppupossu.png" similarity index 100% rename from pomppupossu.png rename to "peli/harkkaty\303\266/pomppu possu/Content/pomppupossu.png" diff --git "a/peli/harkkaty\303\266/pomppu possu/Content/porkkananKuva.png" "b/peli/harkkaty\303\266/pomppu possu/Content/porkkananKuva.png" new file mode 100644 index 0000000000000000000000000000000000000000..c7be6ec5026d7e5796e80d33719057e0b84aeb8d Binary files /dev/null and "b/peli/harkkaty\303\266/pomppu possu/Content/porkkananKuva.png" differ diff --git "a/peli/harkkaty\303\266/pomppu possu/pomppu possu.cs" "b/peli/harkkaty\303\266/pomppu possu/pomppu possu.cs" index 2509b84d55c0c5100074c65a32d35b0a11b17849..487b50cd82fd679b900194385a68b6f8dc600b61 100644 --- "a/peli/harkkaty\303\266/pomppu possu/pomppu possu.cs" +++ "b/peli/harkkaty\303\266/pomppu possu/pomppu possu.cs" @@ -12,8 +12,16 @@ namespace pomppu_possu; /// <summary> /// Eeppinen tasohyppely peli /// </summary> +/// Kenttä pitää vielä luoda tekstitiedostoa käyttäen +/// Täytyy lisätä hyppy käskyihin +/// Lisäsin kuvat Content kansioon mutta ohjelma ei käänny nyt public class pomppu_possu : PhysicsGame { + private Image pomppuPossunKuva = LoadImage("pomppupossu.png"); + private Image porkkanaKuva = LoadImage("porkkananKuva.png"); + + public SoundEffect pisteAani = LoadSoundEffect("maali.wav"); + public override void Begin() {Level.Size = new Vector(1920, 1080); SetWindowSize(1920, 1080); @@ -23,6 +31,7 @@ public class pomppu_possu : PhysicsGame Level.Background.Color = Color.SpringGreen; PhysicsObject pomppuPossu = new PhysicsObject(30, 80, Shape.Rectangle); + pomppuPossu.Image = pomppuPossunKuva; Add(pomppuPossu); Keyboard.Listen(Key.Up, ButtonState.Down, Liikuta, "Liikuttaa pelaajaa ylös", pomppuPossu, new Vector(0,1000)); @@ -33,11 +42,12 @@ public class pomppu_possu : PhysicsGame for (int i = 0; i < 10; i++) { Color[] varit = { Color.Black, Color.White }; - Megaporkkanat ympyra = new Megaporkkanat(60, 60, varit); - ympyra.Shape = Shape.Circle; - ympyra.Position = RandomGen.NextVector(Level.BoundingRect); - AddCollisionHandler<PhysicsObject, Megaporkkanat>(pomppuPossu, ympyra, TormattiinEsineeseen); - Add(ympyra); + Megaporkkanat megaporkkana = new Megaporkkanat(60, 60, varit); + megaporkkana.Shape = Shape.Circle; + megaporkkana.Position = RandomGen.NextVector(Level.BoundingRect); + megaporkkana.Image = porkkanaKuva; + AddCollisionHandler<PhysicsObject, Megaporkkanat>(pomppuPossu, megaporkkana, TormattiinEsineeseen); + Add(megaporkkana); } for (int i = 0; i < 5; i++) @@ -55,6 +65,7 @@ public class pomppu_possu : PhysicsGame public void TormattiinEsineeseen(PhysicsObject tormaaja, Megaporkkanat kohde) { kohde.OtaVastaanOsuma(); + pisteAani.Play(); // tää pitää ehkä siirtää Megaporkkanat luokkaan } /// <summary> diff --git "a/peli/harkkaty\303\266/pomppu possu/pomppu possu.csproj" "b/peli/harkkaty\303\266/pomppu possu/pomppu possu.csproj" index d164748ef3ffb530b112a04baa4bad2904c8c70d..aee6acf37bade12bf0353105f34a738581556d78 100644 --- "a/peli/harkkaty\303\266/pomppu possu/pomppu possu.csproj" +++ "b/peli/harkkaty\303\266/pomppu possu/pomppu possu.csproj" @@ -10,4 +10,12 @@ <PackageReference Include="Jypeli.FarseerPhysics.NET" Version="2.*"/> </ItemGroup> + <ItemGroup> + <Folder Include="Content\" /> + </ItemGroup> + + <ItemGroup> + <Content Include="Content\Content\.DS_Store" /> + </ItemGroup> + </Project>