- Timestamp:
- 2011-06-30 15:00:02 (12 years ago)
- Location:
- 2011/26/JuhoK/SFN
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/JuhoK/SFN/SFN/SFN/Auto.cs
r2362 r2378 12 12 public int moottori = 0; 13 13 public int renkaat = 0; 14 public int vari = 0; 14 15 15 public Auto(string korinnimi, int kori, int moottori, int renkaat)16 public Auto(string korinnimi, int vari, int kori, int moottori, int renkaat) 16 17 { 17 18 this.korinnimi = korinnimi; … … 19 20 this.moottori = moottori; 20 21 this.renkaat = renkaat; 22 this.vari = vari; 21 23 } 22 24 } -
2011/26/JuhoK/SFN/SFN/SFN/Peli.cs
r2362 r2378 21 21 22 22 Image MenuBackround = LoadImage("MenuBackround"); 23 Image kuva = LoadImage("Blues\\Perus1"); 24 Label number, malli, moottori, renkaat, moottorin_hinta, renkaiden_hinta, sell_price, rahat; 23 Label number, malli, moottori, renkaat, moottorin_hinta, renkaiden_hinta, sell_price, rahat, keskiauto; 25 24 26 25 int ChangeColor; 26 27 27 28 28 public override void Begin() … … 47 47 } 48 48 49 autot.Add(new Auto("Model1", 1, 4, 5));50 autot.Add(new Auto("Model3", 3, 9, 1));51 autot.Add(new Auto("Model2", 2, 9, 3));49 autot.Add(new Auto("Model1", 3, 1, 4, 5)); 50 autot.Add(new Auto("Model3", 2, 3, 9, 1)); 51 autot.Add(new Auto("Model2", 1, 2, 9, 3)); 52 52 Keyboard.Listen(Key.Escape, ButtonState.Released, Exit, null); 53 53 Mouse.IsCursorVisible = true; 54 54 CreateMenu(); 55 } 56 57 protected override void Update(Time time) 58 { 59 if (keskiauto != null) 60 { 61 keskiauto.Angle = keskiauto.Angle - Angle.FromDegrees(0.5); 62 } 55 63 } 56 64 … … 99 107 ClearAll(); 100 108 Keyboard.Listen(Key.Escape, ButtonState.Released, Exit, null); 101 Camera.ZoomToLevel();109 //Camera.ZoomToLevel(); 102 110 Level.BackgroundColor = Color.LightGray; 103 111 … … 250 258 } 251 259 260 keskiauto = new Label(40*2, 20*2); 261 keskiauto.Image = kuvat[(autot[ID].kori * 4) + (autot[ID].vari)]; 262 keskiauto.Position = new Vector(0 - oikeareuna.Width / 2, 0); 263 Add(keskiauto); 252 264 } 253 265 … … 257 269 { 258 270 raha -= hinnat[indeksi]; 259 autot.Add(new Auto(mallit[indeksi], indeksi, 1, 1));271 autot.Add(new Auto(mallit[indeksi], ChangeColor, indeksi, 1, 1)); 260 272 ID = autot.Count - 1; 261 273 UpdateHUD(); … … 393 405 renkaiden_hinta.Text = "Price: " + (autot[ID].renkaat * 100).ToString(); 394 406 rahat.Text = "Money: " + raha.ToString(); 407 keskiauto.Image = kuvat[(autot[ID].kori * 4) + (autot[ID].vari)]; 395 408 } 396 409 }
Note: See TracChangeset
for help on using the changeset viewer.