Ignore:
Timestamp:
2014-07-02 14:59:44 (6 years ago)
Author:
mijoilmo
Message:

kaiken muutin

File:
1 edited

Legend:

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

    r5286 r5299  
    1010{ 
    1111    GameObject thrusterEffect; 
    12     Game parent; 
     12    Proto236b parent; 
     13 
    1314    public void rotate(double rotSpeed) 
    1415    { 
     
    2526        //if this.ids, enable ids 
    2627    } 
    27     public Player(Game parent) 
     28    public Player(Proto236b parent) 
    2829        : base(40, 40) 
    2930    { 
    30         this.Image = Proto236b.images["player"]; 
    31         this.Shape = Shape.FromImage(Proto236b.images["player"]); 
    3231        this.parent = parent; 
     32        this.Image = parent.Images["player"]; 
     33        this.Shape = Shape.FromImage(parent.Images["player"]); 
    3334        bool IDS = false; //inertial dampening system, katsotaan pistetäänkö ostettavaksi peliin 
    3435        if (IDS == true) 
     
    4344 
    4445        this.thrusterEffect = new GameObject(40, 40); 
    45         thrusterEffect.Image = Proto236b.images["player_thruster"]; 
     46        thrusterEffect.Image = parent.Images["player_thruster"]; 
    4647        thrusterEffect.IsVisible = false; 
    4748        thrusterEffect.Y -= 20; 
     
    5051    public override void Update(Time time) 
    5152    { 
    52         Game parent = this.parent; 
    53         if (this.X + parent.Level.Width / 2.0 > parent.Level.Right) 
    54         { 
    55             if (this.X > parent.Level.Right) 
    56             { 
    57                 //parent.Camera 
    58                 this.X = parent.Level.Left; 
    59             } 
     53        base.Update(time); 
     54        if (this.X > parent.Level.Right) { 
     55            this.X = parent.Level.Left; 
     56        }else if (this.X < parent.Level.Left){ 
     57            this.X = parent.Level.Right; 
    6058        } 
    61         base.Update(time); 
    6259    } 
    6360} 
Note: See TracChangeset for help on using the changeset viewer.