Changeset 1471 for 2010/30


Ignore:
Timestamp:
2010-07-30 13:06:57 (13 years ago)
Author:
jumakall
Message:
 
Location:
2010/30/jumakall
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2010/30/jumakall/The_Bus_Game_Codetest/Peli.cs

    r1432 r1471  
    44using Jypeli.Assets; 
    55using System.Collections.Generic; 
     6using Jypeli.ScreenObjects; 
    67 
    78public class Peli : TopDownPhysicsGame 
     
    1415    PhysicsObject[] talotaulukko = new PhysicsObject[100]; 
    1516    int talojenlukumäärä = 0; 
     17    int huijauskoodi = 0; 
     18    Timer huijaustimer; 
    1619 
    1720    protected override void Begin() 
    1821    { 
     22        Timer huijaustimer = new Timer(); 
    1923        KineticFriction = 0.8; // Asetetaan kitka 
    2024        Widget ruutu2 = new Widget(10.00, 10.00); 
     
    3337        Keyboard.Listen(Key.Left, ButtonState.Down, kaanny, "Käänny vasemmalle", auto, Angle.Degrees(1)); 
    3438        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 
    3543 
    3644        ShowControlHelp(); 
     
    4755        voimaMittari = new DoubleMeter(10); 
    4856        voimaMittari.MaxValue = 30; 
    49         BarGauge voimaPalkki = new BarGauge(20, 150); 
     57        Jypeli.Widgets.BarGauge voimaPalkki = new Jypeli.Widgets.BarGauge(20, 150); 
    5058        voimaPalkki.BindTo(voimaMittari); 
    5159        Add(voimaPalkki); 
     
    6472        tekstikentta.X = Screen.Right - 78; 
    6573        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    } 
    72114    void kiihdyta(Automobile auto) 
    73115    { 
  • 2010/30/jumakall/The_Bus_Game_codetesting/Peli.cs

    r1407 r1471  
    5454        if (lisaapallo == 1) 
    5555        { 
    56             if (palloja <= 500) 
     56            if (palloja <= 200) 
    5757            { 
    5858                LuoPallo(); 
Note: See TracChangeset for help on using the changeset viewer.