- Timestamp:
- 2011-06-10 12:24:07 (12 years ago)
- Location:
- 2011/23/iltakuop/Blocks/Blocks
- Files:
-
- 1 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/23/iltakuop/Blocks/Blocks/Blocks/Peli2.cs
r1871 r1892 59 59 Image mailanKuva = LoadImage("Maila"); 60 60 Image elämänKuva = LoadImage("elämä"); 61 Image tasomKuva = LoadImage("mtaso"); 61 62 62 63 List<Image> kuvat = new List<Image>(); … … 72 73 List<Label> valikonKohdat; 73 74 List<PhysicsObject> tasot = new List<PhysicsObject>(); 75 List<PhysicsObject> mtasot = new List<PhysicsObject>(); 74 76 List<PhysicsObject> taso2t = new List<PhysicsObject>(); 75 77 List<PhysicsObject> tntt = new List<PhysicsObject>(); … … 202 204 203 205 Label kohta1 = new Label("Palikat"); 204 kohta1.Position = new Vector(- 200, 200);206 kohta1.Position = new Vector(-300, 200); 205 207 valikonKohdat.Add(kohta1); 206 208 kohta1.TextColor = Color.White; 207 209 208 210 Label kohta2 = new Label("Powerupit"); 209 kohta2.Position = new Vector( 200, 200);211 kohta2.Position = new Vector(300, 200); 210 212 valikonKohdat.Add(kohta2); 211 213 kohta2.TextColor = Color.White; … … 216 218 kohta1a.TextColor = Color.White; 217 219 218 219 220 220 Label kohta1b1 = new Label("Vahvistettu palikka, vaatii"); 221 221 kohta1b1.Position = new Vector(Level.Left + 283, 100); … … 228 228 kohta1b2.TextColor = Color.White; 229 229 230 231 230 Label kohta1c1 = new Label("TNT palikka, räjähtää"); 232 231 kohta1c1.Position = new Vector(Level.Left + 261, 25); … … 240 239 241 240 Label kohta1d = new Label("Tuhoutumaton seinä"); 242 kohta1d.Position = new Vector(Level.Left + 25 7, -50);241 kohta1d.Position = new Vector(Level.Left + 258, -50); 243 242 valikonKohdat.Add(kohta1d); 244 243 kohta1d.TextColor = Color.White; 244 245 Label kohta1e1 = new Label("Tykkipalikka, ampuu alas kuteja,"); 246 kohta1e1.Position = new Vector(Level.Left + 320, -100); 247 valikonKohdat.Add(kohta1e1); 248 kohta1e1.TextColor = Color.White; 249 250 Label kohta1e2 = new Label("jotka voivat tuhota mailan"); 251 kohta1e2.Position = new Vector(Level.Left + 288, -125); 252 valikonKohdat.Add(kohta1e2); 253 kohta1e2.TextColor = Color.White; 254 255 256 257 Label kohta2a1 = new Label("Pistepowerupit, kerää ne ja"); 258 kohta2a1.Position = new Vector(Level.Left + 800, 150); 259 valikonKohdat.Add(kohta2a1); 260 kohta2a1.TextColor = Color.White; 261 262 Label kohta2a2 = new Label("saat pisteitä, jotka"); 263 kohta2a2.Position = new Vector(Level.Left + 758, 125); 264 valikonKohdat.Add(kohta2a2); 265 kohta2a2.TextColor = Color.White; 266 267 Label kohta2a3 = new Label("vaihtelevat 1 000 - 5 000"); 268 kohta2a3.Position = new Vector(Level.Left + 792, 100); 269 valikonKohdat.Add(kohta2a3); 270 kohta2a3.TextColor = Color.White; 271 272 Label kohta2b1 = new Label("Mailapowerupit, kerää mailaa"); 273 kohta2b1.Position = new Vector(Level.Left + 814, 50); 274 valikonKohdat.Add(kohta2b1); 275 kohta2b1.TextColor = Color.White; 276 277 Label kohta2b2 = new Label("suurentavaa poweruppia, mutta"); 278 kohta2b2.Position = new Vector(Level.Left + 828, 25); 279 valikonKohdat.Add(kohta2b2); 280 kohta2b2.TextColor = Color.White; 281 282 Label kohta2b3 = new Label("varo mailaa pienentävää poweruppia"); 283 kohta2b3.Position = new Vector(Level.Left + 854, 0); 284 valikonKohdat.Add(kohta2b3); 285 kohta2b3.TextColor = Color.White; 286 287 Label kohta2c1 = new Label("Pallopowerupit, kerää palloa"); 288 kohta2c1.Position = new Vector(Level.Left + 809, -50); 289 valikonKohdat.Add(kohta2c1); 290 kohta2c1.TextColor = Color.White; 291 292 Label kohta2c2 = new Label("suurentavaa poweruppia, mutta"); 293 kohta2c2.Position = new Vector(Level.Left + 828, -75); 294 valikonKohdat.Add(kohta2c2); 295 kohta2c2.TextColor = Color.White; 296 297 Label kohta2c3 = new Label("varo palloa pienentävää poweruppia"); 298 kohta2c3.Position = new Vector(Level.Left + 851, -100); 299 valikonKohdat.Add(kohta2c3); 300 kohta2c3.TextColor = Color.White; 301 302 Label kohta2d1 = new Label("Elämäpowerupit, saat niistä"); 303 kohta2d1.Position = new Vector(Level.Left + 808, -150); 304 valikonKohdat.Add(kohta2d1); 305 kohta2d1.TextColor = Color.White; 306 307 elämä = new PhysicsObject(25, 25); 308 elämä.IgnoresCollisionResponse = true; 309 elämä.Position = new Vector(Level.Left + 620, -140); 310 elämä.Image = elämänKuva; 311 Add(elämä); 312 313 PhysicsObject Power8 = new PhysicsObject(25, 25); 314 Power8.IgnoresCollisionResponse = true; 315 Power8.Position = new Vector(Level.Left + 620, -80); 316 Power8.Image = kuvat[7]; 317 Add(Power8); 318 319 PhysicsObject Power9 = new PhysicsObject(25, 25); 320 Power9.IgnoresCollisionResponse = true; 321 Power9.Position = new Vector(Level.Left + 590, -50); 322 Power9.Image = kuvat[8]; 323 Add(Power9); 324 325 PhysicsObject Power7 = new PhysicsObject(25, 25); 326 Power7.IgnoresCollisionResponse = true; 327 Power7.Position = new Vector(Level.Left + 620, 10); 328 Power7.Image = kuvat[6]; 329 Add(Power7); 330 331 PhysicsObject Power6 = new PhysicsObject(25, 25); 332 Power6.IgnoresCollisionResponse = true; 333 Power6.Position = new Vector(Level.Left + 590, 40); 334 Power6.Image = kuvat[5]; 335 Add(Power6); 336 337 PhysicsObject Power2 = new PhysicsObject(25, 25); 338 Power2.IgnoresCollisionResponse = true; 339 Power2.Position = new Vector(Level.Left + 620, 100); 340 Power2.Image = kuvat[2]; 341 Add(Power2); 342 343 PhysicsObject Power3 = new PhysicsObject(25, 25); 344 Power3.IgnoresCollisionResponse = true; 345 Power3.Position = new Vector(Level.Left + 590, 130); 346 Power3.Image = kuvat[1]; 347 Add(Power3); 348 349 Label kohta2d2 = new Label("lisäelämän ja 200 lisäpistettä"); 350 kohta2d2.Position = new Vector(Level.Left + 816, -175); 351 valikonKohdat.Add(kohta2d2); 352 kohta2d2.TextColor = Color.White; 245 353 246 354 foreach (Label valikonKohta in valikonKohdat) … … 255 363 256 364 PhysicsObject ohjeTaso2 = lisaaTaso2(); 257 ohjeTaso2.Position = new Vector(Level.Left + 100, 8 0);365 ohjeTaso2.Position = new Vector(Level.Left + 100, 85); 258 366 ohjeTaso2.Size = new Vector(80, 20); 259 367 Add(ohjeTaso2); … … 269 377 Add(ohjeTuhoutumaton); 270 378 271 272 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Lopeta, ""); 379 //PhysicsObject ohjeTuhoutumaton = lisaaTasoTuhoutumaton(); TYKKIPALIKKA 380 //ohjeTuhoutumaton.Position = new Vector(Level.Left + 100, -90); 381 //ohjeTuhoutumaton.Size = new Vector(80, 20); 382 //Add(ohjeTuhoutumaton); 383 384 //PhysicsObject ohjePower1 = ; 385 //ohjePower1.Position = new Vector(Level.Left + 600, 150); 386 //ohjePower1.Size = new Vector(20, 20); 387 //Add(ohjePower1); 388 389 390 391 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, ""); 273 392 } 274 393 … … 311 430 //kohta3.TextSize = ; 312 431 313 Label kohta3a = new Label("Miro Aur ala");432 Label kohta3a = new Label("Miro Aurela"); 314 433 kohta3a.Position = new Vector(0, -100); 315 434 valikonKohdat.Add(kohta3a); … … 326 445 kohta3c.TextColor = Color.White; 327 446 328 Label kohta3d = new Label(" Jyväskylän yliopisto & Keski-Suomen opisto");447 Label kohta3d = new Label("Ville Hakulinen"); 329 448 kohta3d.Position = new Vector(0, -175); 330 449 valikonKohdat.Add(kohta3d); 331 450 kohta3d.TextColor = Color.White; 332 451 452 Label kohta3e = new Label("Jyväskylän yliopisto & Keski-Suomen opisto"); 453 kohta3e.Position = new Vector(0, -200); 454 valikonKohdat.Add(kohta3e); 455 kohta3e.TextColor = Color.White; 456 333 457 foreach (Label valikonKohta in valikonKohdat) 334 458 { … … 336 460 } 337 461 338 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Lopeta, "");462 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, ""); 339 463 } 340 464 … … 390 514 Mouse.IsCursorVisible = true; 391 515 Mouse.ListenMovement(1.0, ValikossaLiikkuminen2, null); 392 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Lopeta, "");516 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, ""); 393 517 } 394 518 … … 577 701 TarkistaVoitto(); 578 702 } 703 704 if (kohde.Tag.ToString() == "-taso") 705 { 706 pisteet -= 100; 707 mtasot.Remove(kohde); 708 Timer.SingleShot(0.01, kohde.Destroy); 709 } 710 579 711 if (kohde.Tag.ToString() == "taso2") 580 712 { … … 594 726 595 727 } 728 729 596 730 if (kohde.Tag.ToString() == "TNT") 597 731 { … … 830 964 kentta['_'] = LuoAlaReuna; 831 965 kentta['y'] = LuoYläReuna; 966 kentta['M'] = lisaamTaso; 832 967 kentta.Insert(20, 20); 833 968 } … … 854 989 } 855 990 991 PhysicsObject lisaamTaso() 992 { 993 PhysicsObject mtaso = PhysicsObject.CreateStaticObject(40, 10); 994 mtaso.Tag = "-taso"; 995 mtaso.Image = tasomKuva; 996 mtaso.Restitution = 1.0; 997 mtasot.Add(mtaso); 998 return mtaso; 999 } 1000 1001 PhysicsObject lisaaTykkiTaso() 1002 { 1003 PhysicsObject taso = PhysicsObject.CreateStaticObject(40, 10); 1004 taso.Tag = "taso"; 1005 taso.Image = tasoKuva; 1006 taso.Restitution = 1.0; 1007 tasot.Add(taso); 1008 return taso; 1009 } 1010 1011 856 1012 PhysicsObject lisaaTasoTuhoutumaton() 857 1013 { -
2011/23/iltakuop/Blocks/Blocks/BlocksContent/BlocksContent.contentproj
r1837 r1892 197 197 </Compile> 198 198 </ItemGroup> 199 <ItemGroup> 200 <Compile Include="mtaso.png"> 201 <Name>mtaso</Name> 202 <Importer>TextureImporter</Importer> 203 <Processor>TextureProcessor</Processor> 204 </Compile> 205 </ItemGroup> 199 206 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 200 207 <!-- 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.