Ignore:
Timestamp:
2014-07-03 14:57:04 (5 years ago)
Author:
mijoilmo
Message:
 
File:
1 edited

Legend:

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

    r5361 r5369  
    99class Radar : GameObject 
    1010{ 
     11    private GameObject planet; 
     12    private GameObject ship; 
     13    Proto236b parent; 
    1114    public Radar(Proto236b parent) 
    1215        : base(200, 200) 
    1316    { 
    14         Radar.Image = parent.Images["HUD_radar"]; 
     17        this.parent = parent; 
     18        this.Image = parent.Images["HUD_radar"]; 
    1519        if (parent.CurrentLevel.IsPlanet) 
    1620        { 
    1721            //planet radar 
    18             GameObject planet = new GameObject(130,130); 
     22            this.planet = new GameObject(100, 100); 
    1923            planet.Shape = Shape.Circle; 
    20             planet.Color = Color.Red; 
    2124            Add(planet); 
     25            this.ship = new GameObject(10, 10); 
     26            ship.Color = Color.Red; 
     27            Add(ship); 
    2228        } 
    2329        else 
     
    2834    public override void Update(Time time) 
    2935    { 
    30  
     36        this.ship.X = 0; 
     37        this.ship.Y = 0; 
     38        double length = (parent.Player.Y - parent.Level.Bottom)/parent.Level.Height * 20 + 40; 
     39        this.ship.Position += Vector.FromLengthAndAngle(length,Angle.RightAngle); 
    3140        base.Update(time); 
    3241    } 
Note: See TracChangeset for help on using the changeset viewer.