Пример #1
0
        /// <summary>
        /// This function sets the tile's graphical component
        /// </summary>
        /// <param name="tile">The tile type</param>
        /// <param name="Content">The content manager for loading the art</param>
        public void setArenaTile(ArenaTiles tile, string type, ContentManager Content)
        {
            this.tile = tile;

            // Load the UV Map and model
            texture = Content.Load<Texture2D>("Models/" + type + "/UVMap" + (int) tile);
            model = Content.Load<Model>("Models/tileBase");
        }
Пример #2
0
        /// <summary>
        /// This function returns the direction of the projectile to be fired based on the tile provided.
        /// </summary>
        /// <param name="tile">The tile type</param>
        /// <returns>The fire vector</returns>
        public static Vector3 getFireDirection(ArenaTiles tile)
        {
            Vector3 dir = new Vector3(0, 0, 0);

            switch(tile)
            {
                case ArenaTiles.CORNER_BL:
                {
                    dir.X = -1;
                    dir.Z = 1;
                    break;
                }

                case ArenaTiles.CORNER_BR:
                {
                    dir.X = 1;
                    dir.Z = 1;
                    break;
                }

                case ArenaTiles.CORNER_TL:
                {
                    dir.X = -1;
                    dir.Z = -1;
                    break;
                }

                case ArenaTiles.CORNER_TR:
                {
                    dir.X = 1;
                    dir.Z = -1;
                    break;
                }

                case ArenaTiles.DE_BOTTOM:
                case ArenaTiles.DE_TOP:
                case ArenaTiles.STR_VERT:
                {
                    dir.X = -1;
                    break;
                }

                case ArenaTiles.DE_LEFT:
                case ArenaTiles.DE_RIGHT:
                case ArenaTiles.STR_HOR:
                {
                    dir.Z = -1;
                    break;
                }

                default:
                {
                    dir.Y = 1;
                    break;
                }
            }

            return dir;
        }