source: 2013/30/MiskaK/MW2(My Warfare 2)/MW2(My Warfare 2)/MW2(My Warfare 2)/Tuhoutuva.cs @ 4580

Revision 4580, 925 bytes checked in by anlakane, 6 years ago (diff)

Talletus.

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Jypeli;
6using Jypeli.Assets;
7using Jypeli.Controls;
8using Jypeli.Effects;
9using Jypeli.Widgets;
10
11
12/// <summary>
13/// Annetaan seinille kestolaskuri.
14/// </summary>
15public class Tuhoutuva : PhysicsObject
16{
17    private DoubleMeter kesto;
18    public DoubleMeter Kesto
19    {
20        get { return kesto; }
21        set { kesto = value; }
22    }
23
24    public Tuhoutuva(double width, double height, int kesto)
25        : base(width, height, Shape.Rectangle)
26    {
27        this.kesto = new DoubleMeter(kesto);
28        this.kesto.MinValue = 0;
29        IsUpdated = true;
30    }
31
32    public override void Update(Time time)
33    {
34        if (!MW2_My_Warfare_2_.Peli.OnkoNaytonAlueella(this.Position)) this.Body.IsCollidable = false;
35        else this.Body.IsCollidable = true;
36        base.Update(time);
37    }
38}
Note: See TracBrowser for help on using the repository browser.