Changeset 8832 for 2017/27/OskariK
- Timestamp:
- 2017-07-03 12:45:44 (6 years ago)
- Location:
- 2017/27/OskariK/Pong
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/OskariK/Pong/Pong/Pong/Pong.cs
r8824 r8832 33 33 void LuoKentta() 34 34 { 35 PhysicsObjectvasenReuna = Level.CreateLeftBorder();35 vasenReuna = Level.CreateLeftBorder(); 36 36 vasenReuna.Restitution = 1.0; 37 vasenReuna.KineticFriction = 0.0; 37 38 vasenReuna.IsVisible = false; 38 39 39 PhysicsObjectoikeaReuna = Level.CreateRightBorder();40 oikeaReuna = Level.CreateRightBorder(); 40 41 oikeaReuna.Restitution = 1.0; 42 oikeaReuna.KineticFriction = 0.0; 41 43 oikeaReuna.IsVisible = false; 42 44 43 45 PhysicsObject ylaReuna = Level.CreateTopBorder(); 44 46 ylaReuna.Restitution = 1.0; 47 ylaReuna.KineticFriction = 0.0; 45 48 ylaReuna.IsVisible = false; 49 46 50 47 51 PhysicsObject alaReuna = Level.CreateBottomBorder(); 48 52 alaReuna.Restitution = 1.0; 53 alaReuna.KineticFriction = 0.0; 49 54 alaReuna.IsVisible = false; 50 55 … … 60 65 Add(pallo); 61 66 62 AddCollisionHandler(pallo, KasittelePallonTormays);67 63 68 64 69 maila1 = LuoMaila(Level.Left + 20.0, 0.0); 65 70 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 66 71 AddCollisionHandler(pallo, KasittelePallonTormays); 67 72 } 68 73 … … 148 153 149 154 } 155 const double PALLON_MIN_NOPEUS = 500; 156 157 protected override void Update(Time time) 158 { 159 if (pallo != null && Math.Abs(pallo.Velocity.X) < PALLON_MIN_NOPEUS) 160 { 161 pallo.Velocity = new Vector(pallo.Velocity.X * 1.1, pallo.Velocity.Y); 162 } 163 base.Update(time); 164 } 150 165 }
Note: See TracChangeset
for help on using the changeset viewer.