- Timestamp:
- 2015-07-03 11:42:34 (8 years ago)
- Location:
- 2015/27/BenjaminE/HackNSlashOikea
- Files:
-
- 14 added
- 5 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea.cs
r6760 r6785 11 11 Image ekaPlKuva = LoadImage("ekaPelaajaKuva"); 12 12 PhysicsObject ekaPelaaja; 13 SoundEffect pelaajaKuole = LoadSoundEffect("pelaajaKuole"); 13 14 AssaultRifle pelaajanAse; 14 15 PhysicsObject ammus; 15 16 Image luotiKuva = LoadImage("luoti"); 16 17 SoundEffect ammusAani = LoadSoundEffect("ammusAani"); 17 18 IntMeter pisteLaskuri = new IntMeter(0, 0, 100); 19 20 SoundEffect zombieAani = LoadSoundEffect("zombieAani"); 21 SoundEffect zombieKuole = LoadSoundEffect("zombieKuole"); 22 Image vertaa = LoadImage("vertaa"); 23 ExplosionSystem vertaaEffect; 18 24 double zombieRate = 1.0; 19 25 26 EasyHighScore topLista = new EasyHighScore(); 27 20 28 public override void Begin() 21 29 { 22 //MediaPlayer.Play("musiiki"); 23 //MediaPlayer.IsRepeating = true; 24 25 Level.Background.Color = Color.Black; 26 27 MultiSelectWindow alkuValikko = new MultiSelectWindow("Zombie Attack", "Aloita peli", "Lopeta"); 28 alkuValikko.AddItemHandler(0, AloitaPeli); 29 alkuValikko.AddItemHandler(2, Exit); 30 Add(alkuValikko); 30 Window tyhma = new Window(); 31 AloitaUdella(tyhma); 31 32 } 32 33 33 34 void AloitaPeli() 34 35 { 36 37 MediaPlayer.Play("zombieAaniM"); 38 MediaPlayer.IsRepeating = true; 39 35 40 Vector keski = new Vector(); 36 41 LuoPelaaja(keski); … … 38 43 EnempaZombia(); 39 44 Level.CreateBorders(false); 40 Level.Background.Image = LoadImage("tausta"); 41 Level.Background.TileToLevel(); 45 GameObject tausta = new GameObject(Level.Width, Level.Height); 46 tausta.Image = LoadImage("tausta"); 47 Add(tausta, -3); 42 48 Camera.StayInLevel = true; 43 49 Camera.Follow(ekaPelaaja); … … 74 80 ekaPelaaja.Add(pelaajanAse); 75 81 82 83 Level.AmbientLight = -0.7; 84 85 Light valo = new Light(); 86 valo.Intensity = 1.5; 87 valo.Distance = 150; 88 valo.Position = ekaPelaaja.Position; 89 Add(valo); 90 91 Timer valoAjastin = new Timer(); 92 valoAjastin.Interval = 0.1; 93 valoAjastin.Timeout += delegate 94 { 95 valo.Position = ekaPelaaja.Position; 96 }; 97 valoAjastin.Start(); 98 76 99 AddCollisionHandler(ekaPelaaja, "vihu", PelajaKuole); 100 101 Label pistenaytto = new Label(""); 102 pistenaytto.BindTo(pisteLaskuri); 103 pistenaytto.Position = new Vector(0, Screen.Top - 50.0); 104 pistenaytto.Color = Color.White; 105 pistenaytto.TextScale = new Vector(2.0, 2.0); 106 Add(pistenaytto); 77 107 78 108 Add(ekaPelaaja); … … 82 112 void PelajaKuole(PhysicsObject pelaaja, PhysicsObject vihu) 83 113 { 114 pelaajaKuole.Play(); 84 115 ClearAll(); 85 AlotaUdella(); 86 } 87 88 void AlotaUdella() 116 topLista.EnterAndShow(pisteLaskuri.Value); 117 topLista.HighScoreWindow.Closed += AloitaUdella; 118 Level.Background.Color = Color.Black; 119 } 120 121 void AloitaUdella(Window sender) 89 122 { 90 123 Level.Background.Color = Color.Black; … … 92 125 MultiSelectWindow alkuValikko = new MultiSelectWindow("Zombie Attack", "Aloita peli", "Lopeta"); 93 126 alkuValikko.AddItemHandler(0, AloitaPeli); 94 alkuValikko.AddItemHandler( 2, Exit);127 alkuValikko.AddItemHandler(1, Exit); 95 128 Add(alkuValikko); 96 129 } … … 98 131 void Spawner() 99 132 { 133 vertaaEffect = new ExplosionSystem(vertaa, 100); 134 vertaaEffect.MinLifetime = 0.1; 135 vertaaEffect.MaxLifetime = 0.2; 136 vertaaEffect.MinScale = 4; 137 vertaaEffect.MaxScale = 10; 138 vertaaEffect.MinVelocity = 20.0; 139 vertaaEffect.MaxVelocity = 50.0; 140 Add(vertaaEffect); 141 100 142 Timer spawneri = new Timer(); 101 143 spawneri.Timeout += LuoVihu; … … 132 174 if (ammus != null) 133 175 { 134 ammusAani.Play();135 176 ammus.Height = 1.0; 136 177 ammus.Width = 1.0; 137 178 ammus.Image = luotiKuva; 138 179 ammus.Tag = "ammus"; 180 ammusAani.Play(); 139 181 140 182 AddCollisionHandler(ammus, delegate (PhysicsObject a, PhysicsObject b) … … 170 212 { 171 213 vihu.Destroy(); 214 vertaaEffect.AddEffect(vihu.X, vihu.Y, 100); 215 pisteLaskuri.AddValue(1); 172 216 } 173 217 } -
2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea.csproj.Debug.cachefile
r6760 r6785 6 6 Content\musiiki.xnb 7 7 Content\ammusAani.xnb 8 Content\zombieKuole.xnb 9 Content\pelaajaKuole.xnb 10 Content\vertaa.xnb 11 Content\pisteet.xnb 12 Content\zombieAaniM.xnb 13 Content\zombieAani.xnb 8 14 Content\musiiki.wma 9 Content\ ammusAani.wma15 Content\zombieAaniM.wma -
2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/obj/x86/Debug/ContentPipeline-{E8D421DF-029D-4388-8D7A-2B33D24D9EB1}.xml
r6760 r6785 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ekaPelaajaKuva.xnb</Output> 29 <Time>2015-07-0 2T14:33:09.9802736+03:00</Time>29 <Time>2015-07-03T10:31:18.5551878+03:00</Time> 30 30 </Item> 31 31 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\tausta.xnb</Output> 38 <Time>2015-07-0 2T13:11:48.3374736+03:00</Time>38 <Time>2015-07-03T10:40:19.6691878+03:00</Time> 39 39 </Item> 40 40 <Item> … … 48 48 </Item> 49 49 <Item> 50 <Source>musiiki.mp3</Source> 51 <Name>musiiki</Name> 50 <Source>ammusAani.wav</Source> 51 <Name>ammusAani</Name> 52 <Importer>WavImporter</Importer> 53 <Processor>SoundEffectProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.xnb</Output> 56 <Time>2015-07-03T09:22:45.7211878+03:00</Time> 57 </Item> 58 <Item> 59 <Source>zombieKuole.wav</Source> 60 <Name>zombieKuole</Name> 61 <Importer>WavImporter</Importer> 62 <Processor>SoundEffectProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieKuole.xnb</Output> 65 <Time>2015-07-03T09:26:47.8971878+03:00</Time> 66 </Item> 67 <Item> 68 <Source>pelaajaKuole.wav</Source> 69 <Name>pelaajaKuole</Name> 70 <Importer>WavImporter</Importer> 71 <Processor>SoundEffectProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\pelaajaKuole.xnb</Output> 74 <Time>2015-07-03T09:30:10.4731878+03:00</Time> 75 </Item> 76 <Item> 77 <Source>vertaa.png</Source> 78 <Name>vertaa</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\vertaa.xnb</Output> 83 <Time>2015-07-03T10:35:51.0541878+03:00</Time> 84 </Item> 85 <Item> 86 <Source>zombieAaniM.mp3</Source> 87 <Name>zombieAaniM</Name> 52 88 <Importer>Mp3Importer</Importer> 53 89 <Processor>SongProcessor</Processor> 54 90 <Options>None</Options> 55 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ musiiki.xnb</Output>56 <Extra>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ musiiki.wma</Extra>57 <Time>2015-07-0 2T14:04:41.5265736+03:00</Time>91 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.xnb</Output> 92 <Extra>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.wma</Extra> 93 <Time>2015-07-03T11:26:20.4684822+03:00</Time> 58 94 </Item> 59 95 <Item> 60 <Source> ammusAani.mp3</Source>61 <Name> ammusAani</Name>62 <Importer> Mp3Importer</Importer>63 <Processor>So ngProcessor</Processor>96 <Source>zombieAani.wav</Source> 97 <Name>zombieAani</Name> 98 <Importer>WavImporter</Importer> 99 <Processor>SoundEffectProcessor</Processor> 64 100 <Options>None</Options> 65 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.xnb</Output> 66 <Extra>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.wma</Extra> 67 <Time>2015-07-02T14:47:51.2645736+03:00</Time> 101 <Output>C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAani.xnb</Output> 102 <Time>2015-07-03T09:26:47.8841878+03:00</Time> 68 103 </Item> 69 104 <BuildSuccessful>true</BuildSuccessful> -
2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/obj/x86/Debug/HackNSlashOikea.csproj.FileListAbsolute.txt
r6760 r6785 32 32 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\tausta.xnb 33 33 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\luoti.xnb 34 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\musiiki.xnb35 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\musiiki.wma36 34 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.xnb 37 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\ammusAani.wma 35 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAani.xnb 36 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieKuole.xnb 37 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\pelaajaKuole.xnb 38 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\vertaa.xnb 39 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.xnb 40 C:\MyTemp\BenE\HackNSlashOikea\HackNSlashOikea\HackNSlashOikea\bin\x86\Debug\Content\zombieAaniM.wma -
2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikea/obj/x86/Debug/cachefile-{E8D421DF-029D-4388-8D7A-2B33D24D9EB1}-targetpath.txt
r6760 r6785 4 4 Content\tausta.xnb 5 5 Content\luoti.xnb 6 Content\musiiki.xnb7 Content\musiiki.wma8 6 Content\ammusAani.xnb 9 Content\ammusAani.wma 7 Content\zombieKuole.xnb 8 Content\pelaajaKuole.xnb 9 Content\vertaa.xnb 10 Content\zombieAaniM.xnb 11 Content\zombieAaniM.wma 12 Content\zombieAani.xnb -
2015/27/BenjaminE/HackNSlashOikea/HackNSlashOikea/HackNSlashOikeaContent/HackNSlashOikeaContent.contentproj
r6760 r6785 53 53 </ItemGroup> 54 54 <ItemGroup> 55 <Compile Include="tausta.png">56 <Name>tausta</Name>57 <Importer>TextureImporter</Importer>58 <Processor>TextureProcessor</Processor>59 </Compile>60 </ItemGroup>61 <ItemGroup>62 55 <Compile Include="vihu.png"> 63 56 <Name>vihu</Name> … … 81 74 </ItemGroup> 82 75 <ItemGroup> 83 <Compile Include=" musiiki.mp3">84 <Name> musiiki</Name>85 <Importer> Mp3Importer</Importer>86 <Processor>So ngProcessor</Processor>76 <Compile Include="ammusAani.wav"> 77 <Name>ammusAani</Name> 78 <Importer>WavImporter</Importer> 79 <Processor>SoundEffectProcessor</Processor> 87 80 </Compile> 88 81 </ItemGroup> 89 82 <ItemGroup> 90 <Compile Include="ammusAani.mp3"> 91 <Name>ammusAani</Name> 83 <Compile Include="zombieAani.wav"> 84 <Name>zombieAani</Name> 85 <Importer>WavImporter</Importer> 86 <Processor>SoundEffectProcessor</Processor> 87 </Compile> 88 <Compile Include="zombieKuole.wav"> 89 <Name>zombieKuole</Name> 90 <Importer>WavImporter</Importer> 91 <Processor>SoundEffectProcessor</Processor> 92 </Compile> 93 </ItemGroup> 94 <ItemGroup> 95 <Compile Include="pelaajaKuole.wav"> 96 <Name>pelaajaKuole</Name> 97 <Importer>WavImporter</Importer> 98 <Processor>SoundEffectProcessor</Processor> 99 </Compile> 100 </ItemGroup> 101 <ItemGroup> 102 <Compile Include="vertaa.png"> 103 <Name>vertaa</Name> 104 <Importer>TextureImporter</Importer> 105 <Processor>TextureProcessor</Processor> 106 </Compile> 107 </ItemGroup> 108 <ItemGroup> 109 <Compile Include="tausta.png"> 110 <Name>tausta</Name> 111 <Importer>TextureImporter</Importer> 112 <Processor>TextureProcessor</Processor> 113 </Compile> 114 </ItemGroup> 115 <ItemGroup> 116 <Compile Include="zombieAaniM.mp3"> 117 <Name>zombieAaniM</Name> 92 118 <Importer>Mp3Importer</Importer> 93 119 <Processor>SongProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.