Changeset 7382 for 2016/24/MattiK/ZlandZ/ZlandZ
- Timestamp:
- 2016-06-16 14:57:31 (7 years ago)
- Location:
- 2016/24/MattiK/ZlandZ/ZlandZ
- Files:
-
- 10 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/ZlandZ.cs
r7336 r7382 12 12 const double hyppyNopeus = 750; 13 13 const int RUUDUN_KOKO = 40; 14 private int bossinElamat = 500; 15 EasyHighScore topLista = new EasyHighScore(); 14 16 15 17 PlatformCharacter Leaf; … … 18 20 19 21 LaserGun LeafinAse; 20 22 IntMeter pisteLaskuri; 21 23 Image pelaajanKuva = LoadImage("lintu"); 24 Image gene = LoadImage("gene"); 25 Image nuke = LoadImage("nuke"); 22 26 Image orkki = LoadImage("orkki"); 23 27 Image GuninKuva = LoadImage("gun"); … … 31 35 public override void Begin() 32 36 { 37 MultiSelectWindow alkuValikko = new MultiSelectWindow("ZlandZ", 38 "Aloita peli", "Parhaat pisteet", "Lopeta"); 39 Add(alkuValikko); 40 alkuValikko.AddItemHandler(0, AloitaPeli); 41 alkuValikko.AddItemHandler(1, ParhaatPisteet); 42 alkuValikko.AddItemHandler(2, Exit); 43 Level.Background.Image = LoadImage("niga"); 44 Level.Background.FitToLevel(); 45 alkuValikko.Color = Color.Red; 46 Level.Background.Color = Color.Black; 47 } 48 49 50 51 void AloitaPeli() 52 { 53 ClearAll(); 33 54 Gravity = new Vector(0, -1000); 34 55 … … 43 64 } 44 65 66 void ParhaatPisteet() 67 { 68 } 69 45 70 void LuoKentta() 46 71 { … … 49 74 50 75 kentta.SetTileMethod('#', LisaaTaso); 76 kentta.SetTileMethod('d', LisaaGene); 51 77 kentta.SetTileMethod('G', Lisaagun); 52 78 kentta.SetTileMethod('O', LisaaOrkki); … … 54 80 kentta.SetTileMethod('b', LisaaBox); 55 81 kentta.SetTileMethod('N', LisaaPelaaja); 82 kentta.SetTileMethod('L', LisaaNuke); 56 83 kentta.SetTileMethod('P', LisaaPiikki); 57 84 kentta.SetTileMethod('S', LisaaVihu); … … 59 86 Level.CreateBorders(); 60 87 Level.Background.CreateGradient(Color.Black, Color.Red); 88 61 89 62 90 } … … 98 126 Add(Orkki); 99 127 Orkki.Image = orkki; 100 Orkki.Tag = " pahis";128 Orkki.Tag = "orkki"; 101 129 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 102 130 tasoAivot.Speed = 50; … … 131 159 Add(Box); 132 160 } 161 void LisaaNuke(Vector paikka, double leveys, double korkeus) 162 { 163 PhysicsObject nuke = PhysicsObject.CreateStaticObject(leveys, korkeus); 164 nuke.IgnoresCollisionResponse = true; 165 nuke.Position = paikka; 166 nuke.Image = this.nuke; 167 nuke.Tag = "nuke"; 168 Add(nuke); 169 170 } 171 172 void LisaaGene(Vector paikka, double leveys, double korkeus) 173 { 174 PhysicsObject gene = PhysicsObject.CreateStaticObject(leveys, korkeus); 175 gene.IgnoresCollisionResponse = true; 176 gene.Position = paikka; 177 gene.Image = this.gene; 178 gene.Tag = "gene"; 179 Add(gene); 180 181 } 182 183 133 184 void LisaaVihu(Vector paikka, double leveys, double korkeus) 134 185 { … … 170 221 AddCollisionHandler(Leaf, "pahis", TormaaVihuun); 171 222 AddCollisionHandler(Leaf, "piikki", TormaaPiikkiin); 223 AddCollisionHandler(Leaf, "gene", TormaaGeneen); 172 224 Add(Leaf); 173 225 //pelaaja1 on PlatformCharacter-tyyppinen … … 188 240 kohde.Destroy(); 189 241 } 242 if (kohde.Tag.Equals("orkki")) 243 { 244 bossinElamat -= 10; 245 if (bossinElamat <= 0) kohde.Destroy(); 246 } 190 247 } 191 248 void AmmuAseella(PlatformCharacter pelaaja) … … 206 263 { 207 264 Sombombo.Destroy(); 265 pisteLaskuri.Value += 2; 266 } 267 268 269 void LuoPistelaskuri() 270 { 271 pisteLaskuri = new IntMeter(0); 272 273 Label pisteNaytto = new Label(); 274 pisteNaytto.X = Screen.Left + 100; 275 pisteNaytto.Y = Screen.Top - 100; 276 pisteNaytto.TextColor = Color.Black; 277 pisteNaytto.Color = Color.White; 278 279 pisteNaytto.BindTo(pisteLaskuri); 280 Add(pisteNaytto); 208 281 } 209 282 … … 222 295 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", Leaf, nopeus); 223 296 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", Leaf, hyppyNopeus); 224 225 226 227 } 297 IntMeter pisteLaskuri; 298 } 299 300 301 228 302 229 303 void Liikuta(PlatformCharacter hahmo, double nopeus) … … 243 317 MessageDisplay.Add("Keräsit Boxin!"); 244 318 Box.Destroy(); 319 pisteLaskuri.Value += 5; 245 320 } 246 321 void TormaaVihuun(PhysicsObject hahmo, PhysicsObject vihu) … … 261 336 MessageDisplay.Add("You died"); 262 337 Giant.Destroy(); 338 263 339 } 264 340 void TormaaPiikkiin(PhysicsObject hahmo, PhysicsObject piikki) … … 279 355 Leaf.Weapon.ProjectileCollision = AmmusOsui; 280 356 } 281 357 void TormaaGeneen(PhysicsObject pelaaja, PhysicsObject gene) 358 { 359 StopAll(); 360 PelaajaKuoli(); 361 362 363 364 } 365 366 void PelaajaKuoli() 367 { 368 369 topLista.EnterAndShow(pisteLaskuri.Value); 370 topLista.HighScoreWindow.Closed += PeliLoppui; 371 } 372 373 void PeliLoppui(Window sender) 374 { 375 ClearAll(); 376 Begin(); 377 } 282 378 } -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/ZlandZ.csproj.Debug.cachefile
r7336 r7382 11 11 Content\gun.xnb 12 12 Content\orkki.xnb 13 Content\niga.xnb 14 Content\gene.xnb 15 Content\nuke.xnb -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r7336 r7382 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2016-06-1 5T14:40:38.3402243+03:00</Time>38 <Time>2016-06-16T14:23:58.4053836+03:00</Time> 39 39 </Item> 40 40 <Item> … … 110 110 <Time>2016-06-15T13:25:01.0026751+03:00</Time> 111 111 </Item> 112 <Item> 113 <Source>niga.png</Source> 114 <Name>niga</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\niga.xnb</Output> 119 <Time>2016-06-16T10:23:11.56569+03:00</Time> 120 </Item> 121 <Item> 122 <Source>gene.png</Source> 123 <Name>gene</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gene.xnb</Output> 128 <Time>2016-06-16T11:02:20.9326671+03:00</Time> 129 </Item> 130 <Item> 131 <Source>nuke.png</Source> 132 <Name>nuke</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\nuke.xnb</Output> 137 <Time>2016-06-16T11:15:53.088256+03:00</Time> 138 </Item> 112 139 <BuildSuccessful>true</BuildSuccessful> 113 140 <Settings> -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/ZlandZ.csproj.FileListAbsolute.txt
r7336 r7382 19 19 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gun.xnb 20 20 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\orkki.xnb 21 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\niga.xnb 22 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gene.xnb 23 C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\nuke.xnb -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r7336 r7382 11 11 Content\gun.xnb 12 12 Content\orkki.xnb 13 Content\niga.xnb 14 Content\gene.xnb 15 Content\nuke.xnb -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZContent/ZlandZContent.contentproj
r7336 r7382 123 123 </Compile> 124 124 </ItemGroup> 125 <ItemGroup> 126 <Compile Include="niga.png"> 127 <Name>niga</Name> 128 <Importer>TextureImporter</Importer> 129 <Processor>TextureProcessor</Processor> 130 </Compile> 131 </ItemGroup> 132 <ItemGroup> 133 <Compile Include="gene.png"> 134 <Name>gene</Name> 135 <Importer>TextureImporter</Importer> 136 <Processor>TextureProcessor</Processor> 137 </Compile> 138 </ItemGroup> 139 <ItemGroup> 140 <Compile Include="nuke.png"> 141 <Name>nuke</Name> 142 <Importer>TextureImporter</Importer> 143 <Processor>TextureProcessor</Processor> 144 </Compile> 145 </ItemGroup> 125 146 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 126 147 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2016/24/MattiK/ZlandZ/ZlandZ/ZlandZContent/kentta1.txt
r7336 r7382 3 3 4 4 5 6 ################################################################################################################################################################################################ 5 6 7 7 8 #8 9 9 10 #10 11 11 12 #13 b bb14 S S #15 # ### # b b b # P # P # # # b b b b 16 O S S ## ## S B S # P P # G P P P P # # # # #17 N ####PPP#### PPP S PPPPPPP S PPP B ##P##P##P##P## # PPPPPPPPPPPPP # # # P P P P # S # S # S #18 ############################################################################################################################################################# #################################################19 12 13 b b 14 S S 15 # ### # b b b # P # P # # # b b b b # # # # O 16 S S ## ## S B S # P P # G P P P P # # # # 17 N ####PPP#### b PPP S PPPPPPP S PPP B ##P##P##P##P## # PPPPPPPPPPPPP # # # P P P P # S # S # S # dL 18 #############################################################################################################################################################PPPPPPPPPPPPP#################################### 19
Note: See TracChangeset
for help on using the changeset viewer.