Ignore:
Timestamp:
2014-07-04 11:42:16 (5 years ago)
Author:
mijoilmo
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Player.cs

    r5412 r5427  
    1212    Proto236b parent; 
    1313    private List<Weapon> weapons = new List<Weapon>(); 
     14    private SoundEffect weaponSound; 
     15    private SoundEffect thrusterSound; 
     16    private bool soundPlayed = false; 
    1417 
    1518    public void rotate(double rotSpeed) 
     
    2124        this.thrusterEffect.IsVisible = true; 
    2225        this.Push(Vector.FromLengthAndAngle(speed * 800, this.Angle + Angle.RightAngle)); 
     26        if (!thrusterSound.IsPlaying) 
     27        { 
     28            soundPlayed = false; 
     29        } 
     30        if (!soundPlayed) { thrusterSound.Play(); soundPlayed = true; }; 
    2331    } 
    2432    public void thrusterEnd() 
    2533    { 
    2634        this.thrusterEffect.IsVisible = false; 
     35        soundPlayed = false; 
     36        thrusterSound.Stop(); 
    2737        //if this.ids, enable ids 
    2838    } 
     
    5464        thrusterEffect.Y -= 19; 
    5565        Add(thrusterEffect); 
     66 
     67        this.weaponSound = parent.loadSound("soundFx/lasershot"); 
     68        this.thrusterSound = parent.loadSound("soundFx/raketti"); 
    5669    } 
    5770    public void shoot() 
     
    6275            if (bullet != null) 
    6376            { 
     77                weaponSound.Play(); 
    6478                bullet.Velocity += this.Velocity; 
    6579                bullet.Tag = "bullet"; 
     
    7084    { 
    7185        bullet.Destroy(); 
    72         ((MikonPhysicsObject)target).Break(0,2,2); 
     86        if (target.Tag.Equals("breakable")) 
     87        { 
     88            ((MikonPhysicsObject)target).Break(0, 2, 2); 
     89        } 
    7390    } 
    7491    public void attachWeapon() 
Note: See TracChangeset for help on using the changeset viewer.