- Timestamp:
- 2010-07-30 13:06:57 (13 years ago)
- Location:
- 2010/30/jumakall
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/jumakall/The_Bus_Game_Codetest/Peli.cs
r1432 r1471 4 4 using Jypeli.Assets; 5 5 using System.Collections.Generic; 6 using Jypeli.ScreenObjects; 6 7 7 8 public class Peli : TopDownPhysicsGame … … 14 15 PhysicsObject[] talotaulukko = new PhysicsObject[100]; 15 16 int talojenlukumäärä = 0; 17 int huijauskoodi = 0; 18 Timer huijaustimer; 16 19 17 20 protected override void Begin() 18 21 { 22 Timer huijaustimer = new Timer(); 19 23 KineticFriction = 0.8; // Asetetaan kitka 20 24 Widget ruutu2 = new Widget(10.00, 10.00); … … 33 37 Keyboard.Listen(Key.Left, ButtonState.Down, kaanny, "Käänny vasemmalle", auto, Angle.Degrees(1)); 34 38 Keyboard.Listen(Key.Right, ButtonState.Down, kaanny, "Käänny oikealle", auto, Angle.Degrees(-1)); 39 Keyboard.Listen(Key.B, ButtonState.Pressed, huijaus, "", Key.B); 40 Keyboard.Listen(Key.A, ButtonState.Pressed, huijaus, "", Key.A); 41 Keyboard.Listen(Key.L, ButtonState.Pressed, huijaus, "", Key.L); 42 35 43 36 44 ShowControlHelp(); … … 47 55 voimaMittari = new DoubleMeter(10); 48 56 voimaMittari.MaxValue = 30; 49 BarGauge voimaPalkki = newBarGauge(20, 150);57 Jypeli.Widgets.BarGauge voimaPalkki = new Jypeli.Widgets.BarGauge(20, 150); 50 58 voimaPalkki.BindTo(voimaMittari); 51 59 Add(voimaPalkki); … … 64 72 tekstikentta.X = Screen.Right - 78; 65 73 tekstikentta.Y = Screen.Top - 10; 66 67 68 69 70 } 71 74 Mouse.IsCursorVisible = true; 75 76 77 78 79 } 80 81 void huijaus(Key nappain) 82 { 83 if (nappain == Key.B && huijauskoodi == 0) 84 { 85 huijauskoodi++; 86 Timer.SingleShot(2.0, nollaahuijaus); 87 /* 88 huijaustimer.Interval = 2; 89 huijaustimer.Trigger += nollaahuijaus; 90 huijaustimer.Start();*/ 91 } 92 93 if (nappain == Key.A && huijauskoodi == 1) 94 { 95 huijauskoodi++; 96 } 97 98 if (nappain == Key.L && huijauskoodi == 2) 99 { 100 huijauskoodi++; 101 } 102 103 if (nappain == Key.L && huijauskoodi == 3) 104 { 105 int a = 0;//huijaaus 106 MessageDisplay.Add("Huijari!!!"); 107 huijauskoodi = 0; 108 } 109 } 110 void nollaahuijaus() 111 { 112 huijauskoodi = 0; 113 } 72 114 void kiihdyta(Automobile auto) 73 115 { -
2010/30/jumakall/The_Bus_Game_codetesting/Peli.cs
r1407 r1471 54 54 if (lisaapallo == 1) 55 55 { 56 if (palloja <= 500)56 if (palloja <= 200) 57 57 { 58 58 LuoPallo();
Note: See TracChangeset
for help on using the changeset viewer.