Changeset 4233 for 2013/26/RoopeR
- Timestamp:
- 2013-06-26 13:32:33 (6 years ago)
- Location:
- 2013/26/RoopeR
- Files:
-
- 44 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/26/RoopeR/Pong/Pong/Pong/Pong.cs
r4211 r4233 15 15 PhysicsObject maila1; 16 16 PhysicsObject maila2; 17 PhysicsObject vasenReuna; 18 PhysicsObject oikeaReuna; 17 19 IntMeter pelaajan1Pisteet; 18 20 IntMeter pelaajan2Pisteet; … … 33 35 pallo = new PhysicsObject(40, 40); 34 36 pallo.Shape = Shape.Circle; 35 pallo.Restitution = 2.0;37 pallo.Restitution = 5.0; 36 38 Add(pallo); 37 39 AddCollisionHandler(pallo, KasittelePallonTormays); … … 40 42 41 43 Level.BackgroundColor = Color.Blue; 42 PhysicsObjectvasenReuna = Level.CreateLeftBorder();44 vasenReuna = Level.CreateLeftBorder(); 43 45 vasenReuna.Restitution = 1.0; 44 vasenReuna.IsVisible = false;46 vasenReuna.IsVisible = false; 45 47 48 oikeaReuna = Level.CreateRightBorder(); 49 oikeaReuna.Restitution = 1.0; 50 oikeaReuna.IsVisible = false; 51 52 PhysicsObject ylaReuna = Level.CreateTopBorder(); 53 ylaReuna.Restitution = 1.2; 54 ylaReuna.IsVisible = false; 55 56 PhysicsObject alaReuna = Level.CreateBottomBorder(); 57 alaReuna.Restitution = 0.0; 58 alaReuna.IsVisible = false; 46 59 Camera.ZoomToLevel(-10.5); 47 60 … … 57 70 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 58 71 maila.Color = Color.Emerald; 59 maila.Restitution = 1.0;72 maila.Restitution = 2.0; 60 73 maila.X = x; 61 74 maila.Y = y; … … 113 126 return laskuri; 114 127 } 128 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 129 { 130 if (kohde == oikeaReuna) 131 { 132 pelaajan1Pisteet.Value += 1; 133 } 134 else if (kohde == vasenReuna) 135 { 136 pelaajan2Pisteet.Value += 1; 137 } 138 } 115 139 } 116 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde)117 {118 if (kohde== oikeaReuna)119 }120 pelaajan1pisteet.Value+=1;121 }122 else if (kohde== vasenReuna)123 {124 pelaajan2Pisteet.Value+=1;125 }126 }
Note: See TracChangeset
for help on using the changeset viewer.