Changeset 2958
- Timestamp:
- 2012-06-12 14:39:52 (11 years ago)
- Location:
- 2012/24/MikkoL
- Files:
-
- 54 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/MikkoL/Pong/Pong/Pong/Pong.cs
r2931 r2958 25 25 IntMeter pelaajan2Erat; 26 26 27 Vector impulssi = new Vector( 500, 0);27 Vector impulssi = new Vector(1000, 0); 28 28 29 29 public override void Begin() … … 37 37 void LuoKentta() 38 38 { 39 pallo = new PhysicsObject(25, 25); 40 pallo.Shape = Shape.Circle; 41 pallo.X = 0; 42 pallo.Y = 0; 43 pallo.Restitution = 1.0; 44 pallo.KineticFriction = 0; 45 pallo.CanRotate = true; 46 Add(pallo); 39 luoPallo(0,0); 47 40 48 41 AddCollisionHandler(pallo, KasittelePallonTormaus); … … 71 64 72 65 MessageDisplay.TextColor = Color.White; 73 MessageDisplay.BackgroundColor = Color. Black;66 MessageDisplay.BackgroundColor = Color.Transparent; 74 67 75 68 Camera.ZoomToLevel(); … … 108 101 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 109 102 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 103 104 110 105 } 111 106 … … 138 133 { 139 134 IntMeter laskuri = new IntMeter(0); 140 laskuri.MaxValue = 1 1;135 laskuri.MaxValue = 10; 141 136 Label naytto = new Label(); 142 137 naytto.BindTo(laskuri); … … 144 139 naytto.Y = y; 145 140 naytto.TextColor = Color.White; 146 naytto.BorderColor = Level.BackgroundColor;147 naytto.Color = Level.BackgroundColor;141 naytto.BorderColor = Color.Transparent; 142 naytto.Color = Color.Transparent; 148 143 Add(naytto); 149 144 return laskuri; … … 161 156 } 162 157 163 if (pelaajan1Pisteet.Value >10)158 if (pelaajan1Pisteet.Value == 10) 164 159 { 165 160 pelaajan1Erat.Value += 1; 166 161 Uudelleen(); 167 162 } 168 else if (pelaajan2Pisteet.Value >10)163 else if (pelaajan2Pisteet.Value == 10) 169 164 { 170 165 pelaajan2Erat.Value += 1; … … 182 177 naytto2.Y = y; 183 178 naytto2.TextColor = Color.White; 184 naytto2.BorderColor = Level.BackgroundColor;185 naytto2.Color = Level.BackgroundColor;179 naytto2.BorderColor = Color.Transparent; 180 naytto2.Color = Color.Transparent; 186 181 Add(naytto2); 187 182 return eraLaskuri; … … 193 188 pelaajan2Pisteet.Value = 0; 194 189 190 pallo.Velocity = Vector.Zero; 195 191 pallo.X = 0; 196 192 pallo.Y = 0; 197 193 198 pallo.Hit(impulssi); 194 Timer.SingleShot(2, AloitaPeli); 195 } 196 197 void luoPallo(int x, int y) 198 { 199 pallo = new PhysicsObject(25, 25); 200 pallo.Shape = Shape.Circle; 201 pallo.X = x; 202 pallo.Y = y; 203 pallo.Restitution = 1.0; 204 pallo.KineticFriction = 0; 205 pallo.StaticFriction = 0; 206 pallo.CanRotate = true; 207 Add(pallo); 199 208 } 200 209 } -
2012/24/MikkoL/Pong/Pong/Pong/bin/x86/Debug/Jypeli4.xml
r2931 r2958 12142 12142 </summary> 12143 12143 </member> 12144 <member name="P:Jypeli.Timer.SecondCounterStep"> 12145 <summary> 12146 Kuinka monta sekuntia sekuntilaskuri laskee yhden sekunnin aikana. 12147 Oletus on 1. Arvolla 2 laskuri laskee tuplanopeudella, arvolla -1 taaksepÀin jne. 12148 </summary> 12149 </member> 12144 12150 <member name="P:Jypeli.Timer.Times"> 12145 12151 <summary>
Note: See TracChangeset
for help on using the changeset viewer.