- Timestamp:
- 2013-06-26 09:25:38 (10 years ago)
- Location:
- 2013/26/ChristianS
- Files:
-
- 18 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/26/ChristianS/PinkkiPonkki/PinkkiPonkki/PinkkiPonkki/PinkkiPonkki.cs
r4188 r4228 16 16 PhysicsObject maila1; 17 17 PhysicsObject maila2; 18 19 PhysicsObject vasenReuna; 20 PhysicsObject oikeaReuna; 21 22 IntMeter pelaajan1Pisteet; 23 IntMeter pelaajan2Pisteet; 18 24 19 25 … … 40 46 pallo.Y = 0.0; 41 47 48 AddCollisionHandler(pallo, KasitteleTormays); 49 42 50 maila1 = LuoMaila(Level.Left + 20.0, 0.0); 43 51 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 44 52 45 Level.CreateBorders(1.0, false); 53 vasenReuna = Level.CreateLeftBorder(); 54 vasenReuna.Restitution = 1.0; 55 vasenReuna.KineticFriction = 0.0; 56 vasenReuna.IsVisible = false; 57 58 oikeaReuna = Level.CreateRightBorder(); 59 oikeaReuna.Restitution = 1.0; 60 oikeaReuna.KineticFriction = 0.0; 61 oikeaReuna.IsVisible = false; 62 63 PhysicsObject ylaReuna = Level.CreateTopBorder(); 64 ylaReuna.Restitution = 1.0; 65 ylaReuna.KineticFriction = 0.0; 66 ylaReuna.IsVisible = false; 67 68 PhysicsObject alaReuna = Level.CreateBottomBorder(); 69 alaReuna.Restitution = 1.0; 70 alaReuna.IsVisible = false; 71 alaReuna.KineticFriction = 0.0; 72 46 73 pallo.Restitution = 1.0; 47 74 Level.BackgroundColor = Color.DarkRed; … … 96 123 void LisaaLaskurit() 97 124 { 98 // ... 125 pelaajan1Pisteet = LuoPisteLaskuri(Screen.Left + 100.0, Screen.Top - 100.0); 126 pelaajan2Pisteet = LuoPisteLaskuri(Screen.Right - 100.0, Screen.Top - 100.0); 99 127 } 100 128 IntMeter LuoPisteLaskuri(double x, double y) 101 129 { 102 130 IntMeter laskuri = new IntMeter(0); 103 laskuri.MaxValue = 10;131 laskuri.MaxValue = int.MaxValue; 104 132 105 133 Label naytto = new Label(); … … 113 141 114 142 return laskuri; 115 } 116 143 } 144 void KasitteleTormays(PhysicsObject pallo, PhysicsObject kohde) 145 { 146 if (kohde == oikeaReuna) 147 { 148 pelaajan1Pisteet.Value += RandomGen.NextInt(0, 1000000000); 149 } 150 else if (kohde == vasenReuna) 151 pelaajan2Pisteet.Value += RandomGen.NextInt(0, 1000000000); 152 } 117 153 118 154 }
Note: See TracChangeset
for help on using the changeset viewer.