public Ship GetWorkerShip(Planet planet)
        {
            List<Weapon> weapons = new List<Weapon>();
            weapons.Add(new Weapon(Content.Load<Texture2D>("Weapons/RedLaser"), 90f, 100f, 10, Vector2.Zero, 1000f));

            Ship temp = new Ship(Content.Load<Texture2D>("Ships/SpaceShipExperimentVersion"),
                            new Vector2(planet.X + planet.Width + 30, planet.Y + planet.Height + 30),
                            new Vector2(Scales.ThreeTenth), 3f, Player.Race.Speed, Player.Race.Defence, 1f, 100, 200, "Worker Ship", Player.Name,
                            Circle, weapons);
            temp.PositionFromCenter = planet.PositionFromCenter;
            return temp;
        }
        //---------------------------------------------------------------
        //SHIP SYSTEM QUIT
        //---------------------------------------------------------------
        private void ShipSystemQuit(Ship sender)
        {
            Texture2D texture = Content.Load<Texture2D>("LittleStars/ShipOnMap");
            Texture2D circle = Content.Load<Texture2D>("LittleStars/CurrentPlayerCircle");
            StarOnMap SOM = FindStarOnMapWithThisObject(sender);

            List<Ship> ships = new List<Ship>();
            ships.Add(sender);

            Vector2 position = new Vector2(SOM.Position.X + SOM.Width + 5, SOM.Position.Y + SOM.Height + 5);

            ShipOnMap temp = new ShipOnMap(texture, circle, position, new Vector2(Scales.FourTenth), ships);

            sender.OnClick -= ShipOnClick;
            sender.OnRightButtonClick -= ShipRightButtonClick;
            sender.OnSystemQuit -= ShipSystemQuit;

            screens["GalaxyMap"].Objects["Map"].ToMap().Objects.Add(temp.ToIDraw());
            screens["SolarSystem"].Objects["SolarSystem"].ToSolarSystem().Objects.Remove(sender.ToIDraw());
            //screens["SolarSystem"].Objects["SolarSystem"].ToSolarSystem().Objects = screens["SolarSystem"].Objects["SolarSystem"].ToSolarSystem().Objects.ToList<IDraw>();
        }
Exemplo n.º 3
0
 //---------------------------------------------------------------
 //SHIP ON CLICK
 //---------------------------------------------------------------
 private bool ShipOnClick(Ship sender, MouseState ms)
 {
     return IsHigher(sender.ToIDraw(), ms);
 }
 //---------------------------------------------------------------
 //SHIP RIGHT BUTTON CLICK
 //---------------------------------------------------------------
 private IMoveble ShipRightButtonClick(Ship sender, MouseState ms)
 {
     return FindObjectUnderCursor(ms);
 }