Exemplo n.º 1
0
        //public override void OnDraw(Renderer renderer)
        //{
        //    base.OnDraw(renderer);

        //    if (renderer.Stage == RenderStage.PostBloom && Flying)
        //    {
        //        var Col = new Color(Color.White, 0.25f);

        //        renderer.PrimitivesRenderer.DrawTriangle(new Vector2(0, 375 - 40), new Vector2(1103 + 40, 375), new Vector2(999, 227), Col);
        //        renderer.PrimitivesRenderer.DrawTriangle(new Vector2(0, 375 - 40), new Vector2(999, 227), new Vector2(104, 227), Col);

        //        Col = new Color(Color.Blue, 0.25f);

        //        renderer.PrimitivesRenderer.DrawTriangle(new Vector2(110, 45), new Vector2(985, 45), new Vector2(1072, 10), Col);
        //        renderer.PrimitivesRenderer.DrawTriangle(new Vector2(110, 45), new Vector2(1072, 10), new Vector2(14, 10), Col);

        //        Col = Color.Red;

        //        renderer.PrimitivesRenderer.DrawRectangle(Transform.Position - new Vector2(1, 1), Transform.Position + new Vector2(1, 1), Col);

        //        Col = Color.Blue;

        //        renderer.PrimitivesRenderer.DrawRectangle(DisplacedPosition - new Vector2(1, 1), DisplacedPosition + new Vector2(1, 1), Col);

        //        RestrictionPathCeiling.Draw(renderer.PrimitivesRenderer.DrawTriangle, renderer.PrimitivesRenderer.DrawLine, World.Get<Mouse>().Position);

        //        Col = new Color(Color.Bisque, 0.25f);

        //        renderer.PrimitivesRenderer.DrawRectangle(Tree.Basement.RFIDAntennaCabinet.Collider, Col);
        //    }
        //}

        /// <summary>
        /// Places the drone on the initial floor position, sets its scale and makes it visible & enabled.
        /// </summary>
        public void PlaceOnFloor()
        {
            Transform.SetPosition(INITIAL_POSITION);
            var CeilingPosition = GetCeilingPosition(INITIAL_POSITION);
            var Scale           = RestrictionPathCeiling.GetScale(CeilingPosition.Y);

            Transform.SetScale(Scale);
            Get <Interaction>().SetPosition(INITIAL_POSITION);
            Transform.SetZ(INITIAL_Z);
            Orientation = Directions4.Down;
            Visible     = true;
            Enabled     = true;
        }
Exemplo n.º 2
0
        private Frames GetTalkingFrames(Directions4 direction)
        {
            switch (direction)
            {
            case Directions4.Down: return(FramesTalkingDown);

            case Directions4.Right: return(FramesTalkingRight);

            case Directions4.Up: return(FramesTalkingUp);

            default: return(FramesTalkingLeft);
            }
        }
Exemplo n.º 3
0
        public static Vector2 ToVector2(this Directions4 direction)
        {
            switch (direction)
            {
            case Directions4.Up: return(new Vector2(0, -1));

            case Directions4.Right: return(new Vector2(1, 0));

            case Directions4.Down: return(new Vector2(0, 1));

            case Directions4.Left: return(new Vector2(-1, 0));
            }
            return(Vector2.Zero);
        }
Exemplo n.º 4
0
        private void TurnRight()
        {
            Directions4 Result = Directions4.None;

            switch (Orientation)
            {
            case Directions4.Down: Result = Directions4.Left; break;

            case Directions4.Left: Result = Directions4.Up; break;

            case Directions4.Up: Result = Directions4.Right; break;

            case Directions4.Right: Result = Directions4.Down; break;
            }

            Orientation = Result;
        }
Exemplo n.º 5
0
 public Transform SetDirection(Directions4 value)
 {
     Orientation = value.ToVector2(); return(this);
 }
Exemplo n.º 6
0
 public void Turn(Directions4 direction)
 {
     Direction4 = direction;
 }
Exemplo n.º 7
0
 public void Turn(Directions4 direction)
 {
     Get <Transform>().Turn(direction);
 }