- Timestamp:
- 2010-07-28 10:18:24 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/aneesavi/Pong/Peli.cs
r1336 r1350 12 12 PhysicsObject maila1; 13 13 PhysicsObject maila2; 14 15 PhysicsObject vasenReuna; 16 PhysicsObject oikeaReuna; 14 17 15 18 IntMeter pelaajan1pisteet; … … 37 40 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 38 41 39 Level.CreateBorders(1.0, false); 40 pallo.Restitution = 1.0; 42 vasenReuna = Level.CreateLeftBorder(); 43 vasenReuna.Restitution = 1.0; 44 vasenReuna.IsVisible = false; 45 46 oikeaReuna = Level.CreateRightBorder(); 47 oikeaReuna.Restitution = 1.0; 48 oikeaReuna.IsVisible = false; 49 50 PhysicsObject alaReuna = Level.CreateBottomBorder(); 51 alaReuna.Restitution = 1.0; 52 alaReuna.IsVisible = false; 53 54 PhysicsObject ylaReuna = Level.CreateTopBorder(); 55 ylaReuna.Restitution = 1.0; 56 ylaReuna.IsVisible = false; 57 41 58 42 59 Level.BackgroundColor = Color.Black; 43 60 Camera.ZoomToLevel(); 44 61 AddCollisionHandler(pallo, KasittelePallonTormays); 62 pallo.Restitution = 1.0; 45 63 46 64 … … 115 133 116 134 } 135 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 136 { 137 MessageDisplay.TextColor = Color.White; 138 139 if (kohde == oikeaReuna) 140 { 141 MessageDisplay.Add("SAIT JUURI PISTEEN HERRA VASENPUOLI!!!"); 142 pelaajan1pisteet.Value += 1; 143 } 144 else if (kohde == vasenReuna) 145 { 146 MessageDisplay.Add("SAIT JUURI PISTEEN HERRA OIKEAPUOLI!!!"); 147 pelaajan2pisteet.Value += 1; 148 149 } 150 } 117 151 }
Note: See TracChangeset
for help on using the changeset viewer.