Changeset 7083 for 2015/koodauskerho
- Timestamp:
- 2015-11-14 14:53:32 (7 years ago)
- Location:
- 2015/koodauskerho/AarniAR
- Files:
-
- 23 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFight/StickmansGunFight.cs
r7053 r7083 6 6 using Jypeli.Effects; 7 7 using Jypeli.Widgets; 8 using StickmansGunFightPelaaja; 8 9 9 10 public class StickmansGunFight : PhysicsGame … … 13 14 const int RUUDUN_KOKO = 40; 14 15 15 P latformCharacterpelaaja1;16 P latformCharacterpelaaja2;17 18 Image pelaajanKuva = LoadImage("StickmanA ");16 Pelaaja pelaaja1; 17 Pelaaja pelaaja2; 18 19 Image pelaajanKuva = LoadImage("StickmanAnew"); 19 20 Image tahtiKuva = LoadImage("tahti"); 20 Image pelaaja2Kuva = LoadImage("StickmanB"); 21 Image pelaaja2Kuva = LoadImage("StickmanBnew"); 22 Image[] pelaaja2RunKuvat = LoadImages("StickmanBnewrun1", "StickmanBnewrun2"); 23 Image[] pelaaja1RunKuvat = LoadImages("StickmanAnewrun1", "StickmanAnewrun2"); 21 24 22 25 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 26 29 Gravity = new Vector(0, -1000); 27 30 31 32 MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", 33 "Aloita peli", "Lopeta"); 34 alkuValikko.AddItemHandler(0, AloitaPeli); 35 alkuValikko.AddItemHandler(1, Exit); 36 37 Add(alkuValikko); 38 39 40 41 42 43 SmoothTextures = false; 44 } 45 46 void AloitaPeli() 47 { 28 48 LuoKentta(); 29 49 LisaaNappaimet(); 30 31 50 Camera.ZoomToLevel(); 32 33 SmoothTextures = false;34 51 } 35 52 … … 66 83 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 67 84 { 68 pelaaja1 = new PlatformCharacter(leveys, korkeus); 85 pelaaja1 = new Pelaaja(leveys, korkeus); 86 pelaaja1.Tag = "pelaaja1"; 69 87 pelaaja1.Position = paikka; 70 88 pelaaja1.Mass = 4.0; 71 pelaaja1.Image = pelaajanKuva; 89 pelaaja1.AnimIdle = pelaajanKuva; 90 Animation pelaaja1Anim = new Animation(pelaaja1RunKuvat); 91 pelaaja1Anim.FPS = 8; 92 pelaaja1.AnimWalk = pelaaja1Anim; 72 93 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 73 94 AddCollisionHandler(pelaaja1, "ammus", TormaaLuotiin); … … 76 97 pelaaja1.Weapon.InfiniteAmmo = true; 77 98 99 78 100 //Mitä tapahtuu kun ammus osuu johonkin? 79 101 pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 80 102 Add(pelaaja1); 103 ProgressBar elamaPalkki = new ProgressBar(150, 20); 104 elamaPalkki.X = Screen.Left + 150; 105 elamaPalkki.Y = Screen.Top - 20; 106 elamaPalkki.BindTo(pelaaja1.ElamaLaskuri); 107 Add(elamaPalkki); 108 81 109 } 82 110 void LisaaPelaaja2(Vector paikka, double leveys, double korkeus) 83 111 { 84 pelaaja2 = new PlatformCharacter(leveys, korkeus); 112 pelaaja2 = new Pelaaja(leveys, korkeus); 113 pelaaja2.Tag = "pelaaja2"; 85 114 pelaaja2.Position = paikka; 86 115 pelaaja2.Mass = 4.0; 87 pelaaja2.Image = pelaaja2Kuva; 116 pelaaja2.AnimIdle = pelaaja2Kuva; 117 Animation pelaaja2Anim = new Animation(pelaaja2RunKuvat); 118 pelaaja2Anim.FPS = 8; 119 pelaaja2.AnimWalk = pelaaja2Anim; 88 120 AddCollisionHandler(pelaaja2, "tahti", TormaaTahteen); 89 121 AddCollisionHandler(pelaaja2, "ammus", TormaaLuotiin); … … 95 127 pelaaja2.Weapon.ProjectileCollision = AmmusOsui; 96 128 Add(pelaaja2); 129 ProgressBar elamaPalkki = new ProgressBar(150, 20); 130 elamaPalkki.X = Screen.Right - 150; 131 elamaPalkki.Y = Screen.Top - 20; 132 elamaPalkki.BindTo(pelaaja2.ElamaLaskuri); 133 Add(elamaPalkki); 97 134 } 98 135 … … 141 178 void TormaaLuotiin(PhysicsObject hahmo, PhysicsObject ammus) 142 179 { 143 hahmo.Destroy(); 144 ((PlatformCharacter)hahmo).Weapon.Destroy(); 180 Pelaaja pelaaja = (Pelaaja)hahmo; 181 pelaaja.ElamaLaskuri.Value--; 182 if (pelaaja.ElamaLaskuri.Value <= 0) 183 { 184 hahmo.Destroy(); 185 ((PlatformCharacter)hahmo).Weapon.Destroy(); 186 Label tekstikentta = new Label("teksti"); 187 188 if (hahmo.Tag.Equals("pelaaja2")) tekstikentta = new Label("Player 1 won!"); 189 else tekstikentta = new Label("Player 2 won!"); 190 191 tekstikentta.Position = Screen.Center; 192 Add(tekstikentta); 193 } 145 194 } 146 195 void AmmuAseella(PlatformCharacter pelaaja) … … 168 217 Begin(); 169 218 } 219 170 220 } -
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFight/StickmansGunFight.csproj
r7053 r7083 111 111 </ItemGroup> 112 112 <ItemGroup> 113 <Compile Include="Pelaaja.cs" /> 113 114 <Compile Include="Ohjelma.cs" /> 114 115 <Compile Include="StickmansGunFight.cs" /> -
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFight/StickmansGunFight.csproj.Debug.cachefile
r7053 r7083 3 3 Content\tahti.xnb 4 4 Content\StickmanA.xnb 5 Content\StickmanB.xnb 5 6 Content\kentta1.xnb 6 Content\StickmanB.xnb 7 Content\StickmanBnew.xnb 8 Content\StickmanAnew.xnb 9 Content\StickmanBnewrun1.xnb 10 Content\StickmanBnewrun2.xnb 11 Content\StickmanAnewrun1.xnb 12 Content\StickmanAnewrun2.xnb -
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFight/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r7053 r7083 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\maali.xnb</Output> 11 <Time>2015- 09-19T10:35:47.9414383+03:00</Time>11 <Time>2015-11-14T10:06:34.2376242+02:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\norsu.xnb</Output> 20 <Time>2015- 09-19T10:35:47.9434383+03:00</Time>20 <Time>2015-11-14T10:06:34.2844245+02:00</Time> 21 21 </Item> 22 22 <Item> … … 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\tahti.xnb</Output> 29 <Time>2015- 09-19T10:35:47.9444383+03:00</Time>29 <Time>2015-11-14T10:06:34.3468249+02:00</Time> 30 30 </Item> 31 31 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanA.xnb</Output> 38 <Time>2015-09-19T11:15:59.6668245+03:00</Time> 38 <Time>2015-11-14T10:06:34.3468249+02:00</Time> 39 </Item> 40 <Item> 41 <Source>StickmanB.png</Source> 42 <Name>StickmanB</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanB.xnb</Output> 47 <Time>2015-11-14T10:06:34.3468249+02:00</Time> 39 48 </Item> 40 49 <Item> … … 45 54 <Options>None</Options> 46 55 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\kentta1.xnb</Output> 47 <Time>2015- 09-19T14:03:30.8265939+03:00</Time>56 <Time>2015-11-14T10:06:34.2376242+02:00</Time> 48 57 </Item> 49 58 <Item> 50 <Source>StickmanB .png</Source>51 <Name>StickmanB </Name>59 <Source>StickmanBnew.png</Source> 60 <Name>StickmanBnew</Name> 52 61 <Importer>TextureImporter</Importer> 53 62 <Processor>TextureProcessor</Processor> 54 63 <Options>None</Options> 55 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanB.xnb</Output> 56 <Time>2015-09-19T11:31:41.9768245+03:00</Time> 64 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanBnew.xnb</Output> 65 <Time>2015-11-14T10:30:36.0767786+02:00</Time> 66 </Item> 67 <Item> 68 <Source>StickmanAnew.png</Source> 69 <Name>StickmanAnew</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanAnew.xnb</Output> 74 <Time>2015-11-14T10:30:47.4849193+02:00</Time> 75 </Item> 76 <Item> 77 <Source>StickmanBnewrun1.png</Source> 78 <Name>StickmanBnewrun1</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanBnewrun1.xnb</Output> 83 <Time>2015-11-14T11:32:59.9801315+02:00</Time> 84 </Item> 85 <Item> 86 <Source>StickmanBnewrun2.png</Source> 87 <Name>StickmanBnewrun2</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanBnewrun2.xnb</Output> 92 <Time>2015-11-14T11:33:17.2208554+02:00</Time> 93 </Item> 94 <Item> 95 <Source>StickmanAnewrun1.png</Source> 96 <Name>StickmanAnewrun1</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanAnewrun1.xnb</Output> 101 <Time>2015-11-14T11:48:11.236248+02:00</Time> 102 </Item> 103 <Item> 104 <Source>StickmanAnewrun2.png</Source> 105 <Name>StickmanAnewrun2</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanAnewrun2.xnb</Output> 110 <Time>2015-11-14T11:48:19.8741117+02:00</Time> 57 111 </Item> 58 112 <BuildSuccessful>true</BuildSuccessful> … … 103 157 <Assembly> 104 158 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 105 <Value>2015-09-16T1 3:21:47.6520092+03:00</Value>159 <Value>2015-09-16T12:47:00.0480835+03:00</Value> 106 160 </Assembly> 107 161 </Assemblies> -
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFight/obj/x86/Debug/StickmansGunFight.csproj.FileListAbsolute.txt
r7053 r7083 13 13 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\obj\x86\Debug\StickmansGunFight.pdb 14 14 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanB.xnb 15 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanBnew.xnb 16 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanAnew.xnb 17 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanBnewrun1.xnb 18 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanBnewrun2.xnb 19 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanAnewrun1.xnb 20 C:\MyTemp\AarniAR\StickmansGunFight\StickmansGunFight\StickmansGunFight\bin\x86\Debug\Content\StickmanAnewrun2.xnb -
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFight/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r7053 r7083 3 3 Content\tahti.xnb 4 4 Content\StickmanA.xnb 5 Content\StickmanB.xnb 5 6 Content\kentta1.xnb 6 Content\StickmanB.xnb 7 Content\StickmanBnew.xnb 8 Content\StickmanAnew.xnb 9 Content\StickmanBnewrun1.xnb 10 Content\StickmanBnewrun2.xnb 11 Content\StickmanAnewrun1.xnb 12 Content\StickmanAnewrun2.xnb -
2015/koodauskerho/AarniAR/StickmansGunFight/StickmansGunFight/StickmansGunFightContent/StickmansGunFightContent.contentproj
r7053 r7083 81 81 </Compile> 82 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="StickmanBnew.png"> 85 <Name>StickmanBnew</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="StickmanAnew.png"> 92 <Name>StickmanAnew</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="StickmanBnewrun1.png"> 99 <Name>StickmanBnewrun1</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="StickmanBnewrun2.png"> 106 <Name>StickmanBnewrun2</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 111 <ItemGroup> 112 <Compile Include="StickmanAnewrun1.png"> 113 <Name>StickmanAnewrun1</Name> 114 <Importer>TextureImporter</Importer> 115 <Processor>TextureProcessor</Processor> 116 </Compile> 117 </ItemGroup> 118 <ItemGroup> 119 <Compile Include="StickmanAnewrun2.png"> 120 <Name>StickmanAnewrun2</Name> 121 <Importer>TextureImporter</Importer> 122 <Processor>TextureProcessor</Processor> 123 </Compile> 124 </ItemGroup> 83 125 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 84 126 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.