Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using Jypeli; |
---|
4 | using Jypeli.Assets; |
---|
5 | using Jypeli.Controls; |
---|
6 | using Jypeli.Effects; |
---|
7 | using Jypeli.Widgets; |
---|
8 | |
---|
9 | class 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.Image = parent.Images["HUD_radar"]; |
---|
19 | if (parent.CurrentLevel.IsPlanet) |
---|
20 | { |
---|
21 | //planet radar |
---|
22 | this.planet = new GameObject(100, 100); |
---|
23 | planet.Shape = Shape.Circle; |
---|
24 | Add(planet); |
---|
25 | this.ship = new GameObject(10, 10); |
---|
26 | ship.Color = Color.Red; |
---|
27 | Add(ship); |
---|
28 | } |
---|
29 | else |
---|
30 | { |
---|
31 | //space radar |
---|
32 | } |
---|
33 | } |
---|
34 | public override void Update(Time time) |
---|
35 | { |
---|
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); |
---|
40 | base.Update(time); |
---|
41 | } |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.