Changeset 4320 for 2013


Ignore:
Timestamp:
2013-06-28 12:39:01 (10 years ago)
Author:
chsarre
Message:

Talletus.

Location:
2013/26/ChristianS/Testi/Testi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2013/26/ChristianS/Testi/Testi/Testi/Testi.cs

    r4264 r4320  
    133133        Add(elamaPalkki); 
    134134 
    135         LuoAmmusLaskuri(0, 0); 
     135        //LuoAmmusLaskuri(0, 0); 
    136136    } 
    137137 
     
    177177         */ 
    178178        Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu", rambonAse); 
    179  
     179        Mouse.Listen(MouseButton.Right, ButtonState.Down, RypaleKranu, "Rypälekranu", pelaaja); 
     180    } 
     181 
     182    void RypaleKranu(Pelaaja pelaaja) 
     183    { 
     184        ClusterGrenade c = new ClusterGrenade(30, 3); 
     185        c.Position = pelaaja.Position + Vector.FromLengthAndAngle(50, (Mouse.PositionOnWorld - pelaaja.Position).Angle); 
     186        c.Hit(Vector.FromLengthAndAngle(9000, (Mouse.PositionOnWorld - pelaaja.Position).Angle)); 
     187        Add(c); 
     188        c.Explosion.ShockwaveReachesObject += delegate(IPhysicsObject i, Vector v) { if (i.Tag.ToString() == "vihu") { i.Destroy(); } }; 
    180189    } 
    181190 
     
    263272        olio.X = x; 
    264273        olio.CanRotate = false; 
    265         //olio.Tag = tagi; 
     274        olio.Tag = "vihu"; 
    266275        olio.Image = zombi; 
    267276        olio.Hit(RandomGen.NextVector(10, 100)); 
     
    297306        IntMeter laskuri = new IntMeter(0); 
    298307        laskuri.MaxValue = int.MaxValue; 
    299  
     308        laskuri.AddTrigger(10, TriggerDirection.Up, RypaleKranaattiKayttoon); 
    300309        Label naytto = new Label(); 
    301310        naytto.BindTo(laskuri); 
     
    309318        return laskuri; 
    310319    } 
    311     void LuoAmmusLaskuri(double x, double y) 
    312     { 
    313         Label naytto = new Label(); 
    314         naytto.BindTo(rambonAse.Ammo); 
    315         naytto.X = x; 
    316         naytto.Y = y; 
    317         naytto.TextColor = Color.White; 
    318         naytto.BorderColor = Level.BackgroundColor; 
    319         naytto.Color = Level.BackgroundColor; 
    320         Add(naytto); 
    321     } 
     320 
     321    void RypaleKranaattiKayttoon(int l) 
     322    { 
     323 
     324    } 
     325 
     326   //void LuoAmmusLaskuri(double x, double y) 
     327   // { 
     328       //Label naytto = new Label(); 
     329       //naytto.BindTo(rambonAse.Ammo); 
     330       //naytto.X = x; 
     331       //naytto.Y = y; 
     332       //naytto.TextColor = Color.White; 
     333       //naytto.BorderColor = Level.BackgroundColor; 
     334       //naytto.Color = Level.BackgroundColor; 
     335       //Add(naytto); 
     336    //} 
    322337    void KasitteleammusOsui(PhysicsObject pallo, PhysicsObject kohde) 
    323338    { 
Note: See TracChangeset for help on using the changeset viewer.