Changeset 1370
- Timestamp:
- 2010-07-28 14:02:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/alsiseoi/WorldOfBallcraft/Peli.cs
r1357 r1370 32 32 pelaaja.Y = y; 33 33 Add(pelaaja); 34 AddCollisionHandler(pelaaja, KasittelePelaajanTormays); 34 35 return pelaaja; 35 36 } … … 37 38 void LuoKentta() 38 39 { 39 Level.BackgroundColor = Color.DarkGreen;40 Level.BackgroundColor = new Color (62, 102, 55); 40 41 41 42 Player1 = LuoPelaaja(300, 200, 40, Color.Blue); … … 44 45 45 46 Camera.ZoomToLevel(); 47 //Camera.ZoomFactor = 1.5; 46 48 47 49 VasenReuna = Level.CreateLeftBorder(); … … 60 62 AlaReuna.Restitution = 1.0; 61 63 AlaReuna.IsVisible = true; 64 65 PhysicsObject keppi = new PhysicsObject(20.0, 20.0); 66 keppi.Tag = "kepakko"; 67 Add(keppi); 68 69 Brain aivot = new Brain(); 70 62 71 } 63 72 … … 81 90 Keyboard.Listen(Key.A, ButtonState.Down, AsetaNopeus, "Player1: Liikuta pelaajaa vasemmalle", Player2, NopeusVasemmalle); 82 91 Keyboard.Listen(Key.A, ButtonState.Released, AsetaNopeus, null, Player2, Vector.Zero); 92 93 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); 94 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 83 95 } 84 96 … … 88 100 //pelaaja.Push(suunta); 89 101 } 102 103 void KasittelePelaajanTormays(PhysicsObject pelaaja, PhysicsObject kohde ) 104 { 105 if (pelaaja == Player1) 106 { 107 if (kohde.Tag.ToString() == "kepakko") 108 { 109 kohde.Color = Color.Blue; 110 } 111 } 112 113 } 90 114 } 91 115
Note: See TracChangeset
for help on using the changeset viewer.