- Timestamp:
- 2010-07-27 11:24:56 (13 years ago)
- Location:
- 2010/30/mikrkana
- Files:
-
- 11 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/mikrkana/Pong/Peli.cs
r1291 r1305 17 17 IntMeter pelaajan2Pisteet; 18 18 19 PhysicsObject vasenReuna; 20 PhysicsObject oikeaReuna; 21 19 22 20 23 protected override void Begin() … … 32 35 void LuoKentta() 33 36 { 34 pallo = new PhysicsObject(40.0, 40.0 );35 pallo.Shape = Shapes.Circle;36 pallo.X = -200.0;37 pallo = new PhysicsObject(40.0, 40.0, Shapes.Circle, CollisionShapeQuality.Best); 38 //pallo.Shape = Shapes.Circle; 39 pallo.X = 200.0; 37 40 pallo.Y = 0.0; 38 41 pallo.Restitution = 1.0; … … 43 46 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 44 47 45 Level.CreateBorders(1.0, false); 48 vasenReuna = Level.CreateLeftBorder(); 49 vasenReuna.Restitution = 1.0; 50 vasenReuna.IsVisible = false; 51 52 oikeaReuna = Level.CreateRightBorder(); 53 oikeaReuna.Restitution = 1.0; 54 oikeaReuna.IsVisible = false; 55 56 PhysicsObject alaReuna = Level.CreateBottomBorder(); 57 alaReuna.Restitution = 1.0; 58 alaReuna.IsVisible = false; 59 60 PhysicsObject yläReuna = Level.CreateTopBorder(); 61 yläReuna.Restitution = 1.0; 62 yläReuna.IsVisible = false; 63 46 64 Level.BackgroundColor = Color.Black; 47 65 … … 122 140 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 123 141 { 142 if (kohde == oikeaReuna) 143 { 144 pelaajan1Pisteet.Value += 1; 145 } 146 else if (kohde == vasenReuna) 147 { 148 pelaajan2Pisteet.Value += 1; 149 } 150 124 151 } 125 152
Note: See TracChangeset
for help on using the changeset viewer.