Ignore:
Timestamp:
2014-07-02 10:48:59 (6 years ago)
Author:
mijoilmo
Message:
 
File:
1 edited

Legend:

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

    r5264 r5270  
    1010{ 
    1111    GameObject thrusterEffect; 
     12    Level level; 
    1213    public void rotate(double rotSpeed) 
    1314    { 
     
    1718    { 
    1819        this.thrusterEffect.IsVisible = true; 
    19         this.Push(Vector.FromLengthAndAngle(speed*800, this.Angle + Angle.RightAngle)); 
     20        this.Push(Vector.FromLengthAndAngle(speed * 800, this.Angle + Angle.RightAngle)); 
    2021    } 
    2122    public void thrusterEnd() 
     
    2425        //if this.ids, enable ids 
    2526    } 
    26     public Player() 
     27    public Player(Level level) 
    2728        : base(40, 40) 
    2829    { 
    2930        this.Image = Proto236b.images["player"]; 
     31        this.level = level; 
    3032        bool IDS = true; //inertial dampening system, katsotaan pistetäänkö ostettavaksi peliin 
    3133        if (IDS == true) 
     
    3941        this.AngularDamping = 0.7; 
    4042 
    41         this.thrusterEffect = new GameObject(40,40); 
     43        this.thrusterEffect = new GameObject(40, 40); 
    4244        thrusterEffect.Image = Proto236b.images["player_thruster"]; 
    4345        thrusterEffect.IsVisible = false; 
     
    4749    public override void Update(Time time) 
    4850    { 
    49         if (this.Position.X>Level.Left){} 
     51        if (this.Position.X > this.level.Right) 
     52        { 
     53            this.X = this.level.Left; 
     54        } 
     55        else if (this.Position.X < this.level.Left) 
     56        { 
     57            this.X = this.level.Right; 
     58        } 
    5059        base.Update(time); 
    5160    } 
Note: See TracChangeset for help on using the changeset viewer.