Ignore:
Timestamp:
2015-06-26 09:48:53 (4 years ago)
Author:
anlakane
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora.cs

    r6432 r6434  
    2020    double prevVelocityX = 0.0; 
    2121    const double STOP_LIMIT_X = 1; 
     22    bool controlsActive = true; 
    2223 
    2324    Image level1 = LoadImage("kentta1"); 
     
    277278    void Liikuta(PhysicsObject pelaaja, double suunta) 
    278279    { 
     280        if (!controlsActive) return; 
     281 
    279282        pelaaja.Velocity = new Vector(suunta, pelaaja.Velocity.Y); 
    280283 
     
    285288    void LiikutaYlos(PhysicsObject pelaaja) 
    286289    { 
    287         
     290        if (!controlsActive) return; 
    288291 
    289292        pelaaja.Hit(new Vector(0, HYPPYVOIMA * pelaaja.Mass)); 
     
    464467        TriggerAction = null; 
    465468        tActionTriggered = false; 
     469        controlsActive = true; 
    466470 
    467471        kenttaNro++; 
     
    608612    void Ammu() 
    609613    { 
     614        if (!controlsActive) return; 
     615 
    610616        if (taistelijanAse == null)  
    611617            return; 
     
    629635        AddCollisionHandler(ammus, "jouni", AmmusOsuuViholliseen); 
    630636 
    631         AddCollisionHandler<PhysicsObject, PhysicsObject>(ammus, delegate(PhysicsObject a, PhysicsObject k) { ammus.Destroy(); }); 
     637        AddCollisionHandler<PhysicsObject, PhysicsObject>(ammus, delegate(PhysicsObject a, PhysicsObject k) { 
     638 
     639            if (k.Tag.ToString() == "trigger") return; 
     640            ammus.Destroy(); 
     641        }); 
    632642    } 
    633643 
Note: See TracChangeset for help on using the changeset viewer.