Changeset 4286


Ignore:
Timestamp:
2013-06-27 21:49:19 (10 years ago)
Author:
otelretu
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2013/26/OtsoR/Projekti/Projekti/Projekti/Projekti.cs

    r4285 r4286  
    3737    public IntMeter Health { get { return health; } } 
    3838 
    39     public Enemy(double leveys, double korkeus, Shape muoto) 
    40         : base(leveys, korkeus, muoto) 
    41     { 
    42         ProgressBar enemyhealth = new ProgressBar(6, 2.5); 
     39    public Enemy(double width, double height, Shape shape, double barwidth, double barheight, double barx) 
     40        : base(width, height, shape) 
     41    { 
     42        ProgressBar enemyhealth = new ProgressBar(barwidth, barheight); 
    4343        enemyhealth.BindTo(health); 
    44         enemyhealth.X = -8; 
    45         enemyhealth.Angle = Angle.RightAngle; 
    46         Add(enemyhealth); 
    47         health.LowerLimit += delegate 
    48         { 
    49             this.Destroy(); 
    50         }; 
    51     } 
    52 } 
    53 class BigEnemy : PhysicsObject 
    54 { 
    55     private IntMeter health = new IntMeter(100, 0, 100); 
    56     public IntMeter Health { get { return health; } } 
    57  
    58     public BigEnemy(double leveys, double korkeus, Shape muoto) 
    59         : base(leveys, korkeus, muoto) 
    60     { 
    61         ProgressBar enemyhealth = new ProgressBar(6, 2.5); 
    62         enemyhealth.BindTo(health); 
    63         enemyhealth.X = -20; 
     44        enemyhealth.X = barx; 
    6445        enemyhealth.Angle = Angle.RightAngle; 
    6546        Add(enemyhealth); 
     
    321302    void Createhostile(int randomship, double randomy, double randomx) 
    322303    { 
    323         Enemy hostile = new Enemy(14, 14, Shape.FromImage(shipimages[randomship])); 
     304        Enemy hostile = new Enemy(14, 14, Shape.FromImage(shipimages[randomship]), 5, 2.5, -8); 
    324305        hostile.Image = shipimages[randomship]; 
    325306        hostile.Y = randomy; 
     
    358339    void Createbighostile(double y, double x) 
    359340    { 
    360         Enemy Big1 = new Enemy(50, 28, Shape.FromImage(bigenemy)); 
     341        Enemy Big1 = new Enemy(50, 28, Shape.FromImage(bigenemy), 20, 2.5, -28); 
    361342        Big1.Image = bigenemy; 
    362343        Big1.X = x; 
Note: See TracChangeset for help on using the changeset viewer.