source: 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Radar.cs @ 5388

Revision 5388, 1.2 KB checked in by mijoilmo, 6 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9class Radar : GameObject
10{
11    private GameObject planet;
12    private GameObject ship;
13    Proto236b parent;
14    public Radar(Proto236b parent)
15        : base(200, 200)
16    {
17        this.parent = parent;
18        this.Animation = new Animation(parent.ImageLists["HUD_radar"]);
19        this.Animation.FPS = 30;
20        this.Animation.Start();
21        if (parent.CurrentLevel.IsPlanet)
22        {
23            //planet radar
24            this.planet = new GameObject(133, 133);
25            planet.Shape = Shape.Circle;
26            Add(planet);
27            this.ship = new GameObject(10, 10);
28            Add(ship);
29        }
30        else
31        {
32            //space radar
33        }
34    }
35    public override void Update(Time time)
36    {
37        this.ship.X = 0;
38        this.ship.Y = 0;
39        double length = ((parent.Player.Y-(parent.Level.Bottom+parent.Level.Height/2))/parent.Level.Height)*22+66;
40        this.ship.Position += Vector.FromLengthAndAngle(length,Angle.FromRadians(0.9721));
41        base.Update(time);
42    }
43}
Note: See TracBrowser for help on using the repository browser.