Exemple #1
0
        public void TravelToPlanet(Planet planet)
        {
            if (this.onShip != null)
            {
                //Set position closest to the ship
                int landTileX;
                int landTileY;
                planet.GetTileCoordinatesFromPosition(onShip.Position, out landTileX, out landTileY);
                landTileY = planet.Height;

                SetParent(
                    planet,
                    FollowParentParameters.Default,
                    planet.GetPositionFromTileCoordinate(landTileX, landTileY),
                    0.0f
                    );

                //Leave ship
                this.onShip = null;
            }
            else
            {
                SetParent(
                    planet,
                    FollowParentParameters.Default,
                    planet.GetPositionFromTileCoordinate(0, planet.Height),
                    0.0f
                    );
            }

            Visible = true;
        }
Exemple #2
0
        private void AddAvatar()
        {
            Planet planet = GetPlanet(startingPlanet);

            avatar = universeFactory.GetAvatar();
            avatar.Init(
                new Vector2(0.75f, 1.05f),
                planet,
                FollowParentParameters.Default,
                planet.GetPositionFromTileCoordinate(0, planet.Height),
                0.0f
                );

            AddUniverseObject(avatar);
        }