Changeset 1756
- Timestamp:
- 2011-06-08 13:42:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/23/iltakuop/Blocks/Blocks/Blocks/Peli.cs
r1751 r1756 14 14 : base(40, 10) 15 15 { 16 16 MakeStatic(); 17 17 } 18 18 … … 26 26 public class Peli : PhysicsGame 27 27 { 28 Vector nopeusOikea = new Vector( 500, 0);29 Vector nopeusVasen = new Vector(- 500, 0);28 Vector nopeusOikea = new Vector(600, 0); 29 Vector nopeusVasen = new Vector(-600, 0); 30 30 31 31 PhysicsObject pallo; … … 44 44 Image taso2Kuva = LoadImage("Vahvistettu palikka"); 45 45 Image taso2Kuva2 = LoadImage("Vahvistettu palikka2"); 46 Image taustaKuva = LoadImage("taustakuva"); 46 47 int pisteet; 47 48 int elämät = 3; … … 76 77 void LuoKenttä(int a) 77 78 { 78 Level.BackgroundColor = Color.Red; 79 LuoPalikat(a); 79 80 LuoPalikat(a); 81 Level.Background.Image = taustaKuva; 82 Level.Background.FitToLevel(); 83 80 84 Camera.ZoomToLevel(1); 81 85 } … … 103 107 104 108 Keyboard.Listen(Key.T, ButtonState.Pressed, AloitaPeli, "Liikuta mailaa vasemmalle"); 105 //Keyboard.Listen(Key.R, ButtonState.Pressed, DebugRäjäytys, "Liikuta mailaa vasemmalle");109 Keyboard.Listen(Key.R, ButtonState.Pressed, DebugRäjäytys, "Liikuta mailaa vasemmalle"); 106 110 107 111 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); … … 112 116 113 117 } 114 //void DebugRäjäytys() { Räjähdys(tnt.Position); }118 void DebugRäjäytys() { Räjähdys(tnt.Position); } 115 119 116 120 void LisääLaskurit(int elämät, int pisteet) … … 123 127 { 124 128 IntMeter laskuri = new IntMeter(määrä); 125 //laskuri.MaxValue = 9;126 129 Label näyttö = new Label(); 127 130 näyttö.BindTo(laskuri); … … 129 132 näyttö.Y = y; 130 133 näyttö.TextColor = Color.White; 131 näyttö.BorderColor = Level.BackgroundColor;132 näyttö.Color = Level.BackgroundColor;133 134 Add(näyttö); 134 135 return laskuri; … … 244 245 } 245 246 } 247 int w = 0; 248 while (w < taso2t.Count) 249 { 250 if (((taso2t[w].X - kohde.X) < 100) && ((taso2t[w].X - kohde.X) > -100) 251 && ((taso2t[w].Y - kohde.Y) < 80) && ((taso2t[w].Y - kohde.Y) > -80)) 252 { 253 taso2t[w].Destroy(); 254 taso2t.RemoveAt(w); 255 pisteet += 300; 256 pisteetL.Value = pisteet; 257 } 258 else 259 { 260 w++; 261 } 262 } 246 263 int o = 0; 247 264 while (o<tntt.Count)
Note: See TracChangeset
for help on using the changeset viewer.