Changeset 9079 for 2017/30/LuukasM/Pong/Pong/Pong/Pong.cs
- Timestamp:
- 2017-07-25 10:13:04 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/30/LuukasM/Pong/Pong/Pong/Pong.cs
r9074 r9079 20 20 IntMeter pelaajan1Pisteet; 21 21 IntMeter pelaajan2Pisteet; 22 23 PhysicsObject oikeaReuna; 24 PhysicsObject vasenReuna; 25 22 26 23 27 public override void Begin() … … 48 52 49 53 50 PhysicsObjectvasenReuna = Level.CreateLeftBorder();54 vasenReuna = Level.CreateLeftBorder(); 51 55 vasenReuna.Restitution = 1.0; 52 56 vasenReuna.IsVisible = false; 53 57 54 58 55 PhysicsObjectoikeaReuna = Level.CreateRightBorder();59 oikeaReuna = Level.CreateRightBorder(); 56 60 oikeaReuna.Restitution = 1.0; 57 61 oikeaReuna.IsVisible = false; … … 62 66 63 67 64 PhysicsObject ylaReuna = Level.CreateTopBorder ;68 PhysicsObject ylaReuna = Level.CreateTopBorder(); 65 69 ylaReuna.Restitution = 1.0; 66 70 ylaReuna.IsVisible = false; … … 144 148 return laskuri; 145 149 } 146 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde 150 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 151 147 152 { 148 153 if (kohde == oikeaReuna) … … 157 162 } 158 163 164 165 const double PALLON_MIN_NOPEUS = 500; 166 167 protected override void Update(Time time) 168 { 169 if (Pallo != null && Math.Abs(Pallo.Velocity.X) < PALLON_MIN_NOPEUS) 170 { 171 Pallo.Velocity = new Vector(Pallo.Velocity.X * 1.1, Pallo.Velocity.Y); 172 } 173 base.Update(time); 174 } 175 159 176 }
Note: See TracChangeset
for help on using the changeset viewer.