Changeset 5284 for 2014/27


Ignore:
Timestamp:
2014-07-02 11:52:31 (5 years ago)
Author:
mijoilmo
Message:
 
Location:
2014/27/AleksanteriV/Protokolla236TrueSurvivor
Files:
1 added
6 edited

Legend:

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

    r5280 r5284  
    1010{ 
    1111    GameObject thrusterEffect; 
    12     Level level; 
    13     Camera camera; 
     12    Game parent; 
    1413    public void rotate(double rotSpeed) 
    1514    { 
     
    2625        //if this.ids, enable ids 
    2726    } 
    28     public Player(Level level) 
     27    public Player(Game parent) 
    2928        : base(40, 40) 
    3029    { 
    3130        this.Image = Proto236b.images["player"]; 
    32         this.level = level; 
     31        this.parent = parent; 
    3332        bool IDS = true; //inertial dampening system, katsotaan pistetäänkö ostettavaksi peliin 
    3433        if (IDS == true) 
     
    5049    public override void Update(Time time) 
    5150    { 
    52         if (this.X + this.level.Width / 2.0 > this.level.Right) 
     51        Game parent = this.parent; 
     52        if (this.X + parent.Level.Width / 2.0 > parent.Level.Right) 
    5353        { 
    54             if (this.Position.X > this.level.Right) 
     54            if (this.X > parent.Level.Right) 
    5555            { 
    56                 //((Game)this.Parent).Camera 
    57                 this.X = this.level.Left; 
     56                //parent.Camera 
     57                this.X = parent.Level.Left; 
    5858            } 
    5959        } 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs

    r5270 r5284  
    6666        // TODO: Kirjoita peli tähän 
    6767        LoadAllImages(); 
    68         this.player = new Player(Level); 
     68        this.player = new Player(this); 
    6969        this.player.IsUpdated = true; 
    7070        LoadLevel("0"); 
Note: See TracChangeset for help on using the changeset viewer.