public override void draw(Spine.SkeletonRenderer sb)
        {
            //sb.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), position, Color.Black, 0.0f, new Vector2(48));
            //sb.Draw(Game1.whitePixel, position, null, Color.Black, 0.0f, Vector2.Zero, new Vector2(48, 48), SpriteEffects.None, 0.5f);
            //sb.Draw(Game1.whitePixel, CenterPoint, null, Color.White, angle, Vector2.Zero, new Vector2(radius, 10.0f), SpriteEffects.None, 0.5f);

            if (state == mutantBallState.Agressive)
            {
                float interpolate = Vector2.Distance(ball_coordinate, CenterPoint);

                for (int i = 0; i <= (int)(interpolate); i += 3)
                {
                    chain_ball.drawAnimationFrame(0.0f, sb, new Vector2(current_skeleton.Skeleton.FindBone("head").WorldX, current_skeleton.Skeleton.FindBone("head").WorldY) + new Vector2(i * (float)(Math.Cos(angle)), i * (float)(Math.Sin(angle))), new Vector2(1.0f), 0.5f, angle, CenterPoint, Color.White);
                }
            }
            if (state == mutantBallState.Agressive)
            {
                if (radius < radius_max)
                {
                    radius += 2.0f;
                }
            }
            else
            {
                if (radius > 0)
                {
                    radius -= 2.0f;
                    angle  += 0.1f;
                }
            }
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            if (state == ShopKeeperState.Normal)
            {
                for (int i = 0; i < 3; i++)
                {
                    if (itemsForSale[i] == GlobalGameConstants.itemType.NoItem)
                    {
                        continue;
                    }

                    Vector2 drawItemPos = position + new Vector2((-3 * GlobalGameConstants.TileSize.X) + (i * 3f * GlobalGameConstants.TileSize.X), (2.5f * GlobalGameConstants.TileSize.Y));

                    itemIcons[i].drawAnimationFrame(0.0f, sb, drawItemPos, new Vector2(1.0f, 1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                }

                if (playerOverlap)
                {
                    buyPic.drawAnimationFrame(0.0f, sb, buyLocation, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
                    leftBuyButton.drawAnimationFrame(0.0f, sb, buyLocation - new Vector2(58, 0) + (new Vector2(0, -0.1f) * (((float)Math.Sin(animationTime)) / 0.01f)), new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
                    rightBuyButton.drawAnimationFrame(0.0f, sb, buyLocation + new Vector2(70, 0) + (new Vector2(0, -0.1f) * (((float)Math.Sin(animationTime)) / 0.01f)), new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
                }
            }

            if (projectile.active)
            {
                shopKeeperFrameAnimationTest.drawAnimationFrame(animationTime * 1000f, sb, projectile.position, new Vector2(1), 0.5f, projectile.direction, Vector2.Zero, Color.White);
            }
        }
Example #3
0
 public void draw(Spine.SkeletonRenderer sb)
 {
     if (shot.active)
     {
         //wandPic.drawAnimationFrame(0.0f, sb, shot.centerPoint, new Vector2(3.0f, 3.0f), 0.6f, shot.timeAlive, new Vector2(8.0f, 8.0f));
         wandPic.drawAnimationFrame(0.0f, sb, shot.centerPoint, new Vector2(1), 0.5f, shot.timeAlive, Vector2.Zero, Color.White);
     }
 }
 public void draw(Spine.SkeletonRenderer sb)
 {
     if (drawPointer)
     {
         img.drawAnimationFrame(0.0f, sb, drawPos, new Vector2(1), 0.5f, theta + (float)(Math.PI / 2), Vector2.Zero, Color.White);
         img2.drawAnimationFrame(0.0f, sb, drawPos2, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
     }
 }
Example #5
0
        public override void draw(Spine.SkeletonRenderer sb)
        {
            if (chaserState == SlowChaserState.WindUp && chaseIteration == 0)
            {
                konamiAlert.drawAnimationFrame(0.0f, sb, position - new Vector2(0, konamiAlert.FrameHeight * 3), new Vector2(3), 0.5f, 0.0f, Vector2.Zero, Color.White);
            }

            //sb.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), position, Color.Lerp(Color.Blue, Color.Red, aggressionTime / maxAggressionTime), 0.0f, dimensions);
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            if (doubled && other != null)
            {
                other.draw(sb);
            }

            anim.drawAnimationFrame(animation_time, sb, position, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            if (minionState == BroodLingState.Dead)
            {
                return;
            }

            if (minionState == BroodLingState.Egg)
            {
                eggAnim.drawAnimationFrame(animation_time, sb, position, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
                //eggAnim.drawAnimationFrame(animation_time, sb, position, new Vector2(1), 0.5f);
            }
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            for (int i = 0; i < bulletSupply; i++)
            {
                //sb.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), sightBox.position, Color.Wheat, 0.0f, sightBox.hitbox / 2);

                if (bullets[i].active == false)
                {
                    continue;
                }

                bulletAnim.drawAnimationFrame(0, sb, bullets[i].position - (bulletAnim.FrameDimensions / 2), new Vector2(1), 0.5f, (float)Math.Atan2(bullets[i].velocity.Y, bullets[i].velocity.X), Vector2.Zero, Color.White);
            }
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            //sb.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), position, Color.Green, 0.0f, new Vector2(48));

            if (state == ChainState.Throw || state == ChainState.Pull)
            {
                float interpolate = Vector2.Distance(chain_position, new Vector2(directionAnims[(int)direction_facing].Skeleton.FindBone("rHand").WorldX, directionAnims[(int)direction_facing].Skeleton.FindBone("rHand").WorldY));

                for (int i = 0; i <= (int)(interpolate); i += 16)
                {
                    hook.drawAnimationFrame(0.0f, sb, new Vector2(directionAnims[(int)direction_facing].Skeleton.FindBone("rHand").WorldX, directionAnims[(int)direction_facing].Skeleton.FindBone("rHand").WorldY) + new Vector2(i * (float)(Math.Cos(angle)), i * (float)(Math.Sin(angle))), new Vector2(1.0f), 0.5f, angle, Vector2.Zero, Color.White);
                }
            }
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            AnimationLib.FrameAnimationSet dropAnim = null;

            dropAnim = GlobalGameConstants.WeaponDictionary.weaponInfo[(int)item_type].pickupImage;

            if (dropAnim != null)
            {
                dropAnim.drawAnimationFrame(0.0f, sb, position, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
            }
            else
            {
                //sb.Draw(Game1.whitePixel, position, null, Color.Black, 0.0f, Vector2.Zero, dimensions, SpriteEffects.None, 0.5f);
            }
        }
 public override void draw(Spine.SkeletonRenderer sb)
 {
     if (state == DropState.Active)
     {
         if (dropItem == DropItemType.CoinDrop)
         {
             coinAnim.drawAnimationFrame(animationTime, sb, this.position, new Vector2(image_size), 0.5f, 0.0f, Vector2.Zero, Color.White);
         }
         else if (dropItem == DropItemType.MedDrop)
         {
             medAnim.drawAnimationFrame(animationTime, sb, this.position, new Vector2(image_size), 0.5f, 0.0f, Vector2.Zero, Color.White);
         }
         else if (dropItem == DropItemType.AmmoDrop)
         {
             ammoAnim.drawAnimationFrame(animationTime, sb, this.position, new Vector2(image_size), 0.5f, 0.0f, Vector2.Zero, Color.White);
         }
     }
 }
        public void draw(Spine.SkeletonRenderer sb)
        {
            switch (bomb_state)
            {
            case Bomb_State.placed:
                //sb.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), position, Color.Red, 0.0f, hitbox);

                bombAnim.drawAnimationFrame(animation_time, sb, position, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
                break;

            case Bomb_State.exploded:
                //sb.DrawSpriteToSpineVertexArray(Game1.whitePixel, new Rectangle(0, 0, 1, 1), position, Color.Red, 0.0f, hitbox);
                explosionAnim.drawAnimationFrame(animation_time, sb, position, new Vector2(2.25f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                break;

            default:
                break;
            }
        }
        public override void draw(Spine.SkeletonRenderer sb)
        {
            for (int i = 0; i < tailPiecesCount; i++)
            {
                if (i == 8)
                {
                    //tailAnimB.drawAnimationFrame(0.0f, sb, tailData[i, tailMostRecent].position + tailAnimB.FrameDimensions / 2, new Vector2(1), 0.5f, tailData[i, tailMostRecent].rotation, tailAnimB.FrameDimensions / 2);
                }
                else
                {
                    tailAnimA.drawAnimationFrame(animation_time, sb, tailData[i, tailMostRecent].position + tailAnimA.FrameDimensions / 2, new Vector2(1), 0.5f, tailData[i, tailMostRecent].rotation, Vector2.Zero, Color.White);
                    //tailAnimA.drawAnimationFrame(animation_time, sb, tailData[i, tailMostRecent].position + tailAnimA.FrameDimensions / 2, new Vector2(1), 0.5f, tailData[i, tailMostRecent].rotation, tailAnimA.FrameDimensions / 2);
                }
            }

            testAnim.drawAnimationFrame(animation_time, sb, position + dimensions / 2, new Vector2(0), 0.5f, 0.0f, Vector2.Zero, Color.White);
            //testAnim.drawAnimationFrame(animation_time, sb, position + dimensions / 2, new Vector2(1), 0.6f, direction, testAnim.FrameDimensions / 2);

            /*
             * for (int i = 0; i < secondaryHitBoxCount; i++)
             * {
             *  sb.Draw(Game1.whitePixel, secondaryHitBoxes[i].Position, null, Color.Magenta, 0.0f, Vector2.Zero, secondaryHitBoxes[i].Dimensions, SpriteEffects.None, 0.7f);
             * }*/
        }
 public override void draw(Spine.SkeletonRenderer sb)
 {
     anims.drawAnimationFrame(0.0f, sb, Position, new Vector2(1), 0.5f, 0.0f, Vector2.Zero, Color.White);
 }
Example #15
0
        public void render(SpriteBatch sb)
        {
            Color textColor  = Color.Lerp(CampaignLobbyState.getSquareColor(GameCampaign.PlayerColor), Color.White, (float)(Math.Sin(flickerTime / 500f) + 1.0f) / 2);
            Color text2Color = Color.Lerp(CampaignLobbyState.getSquareColor(GameCampaign.Player2Color), Color.White, (float)(Math.Sin(flickerTime / 500f) + 1.0f) / 2);

            AnimationLib.FrameAnimationSet player_first_weapon  = GlobalGameConstants.WeaponDictionary.weaponInfo[(int)GameCampaign.Player_Right_Item].pickupImage;
            AnimationLib.FrameAnimationSet player_second_weapon = GlobalGameConstants.WeaponDictionary.weaponInfo[(int)GameCampaign.Player_Left_Item].pickupImage;

            AnimationLib.FrameAnimationSet player2_first_weapon  = GlobalGameConstants.WeaponDictionary.weaponInfo[(int)GameCampaign.Player2_Item_1].pickupImage;
            AnimationLib.FrameAnimationSet player2_second_weapon = GlobalGameConstants.WeaponDictionary.weaponInfo[(int)GameCampaign.Player2_Item_2].pickupImage;

            //sb.Draw(Game1.whitePixel, XboxTools.GetTitleSafeArea(AnimationLib.GraphicsDevice, 0.8f), new Color(0.0f, 0.75f, 1.0f, 0.6f));

            string player_health_display     = "H: ";
            string ammunition_amount_display = "A: ";
            string coin_amount_display       = GameCampaign.Player_Coin_Amount.ToString();
            string Player_Right_Item         = "R: ";
            string Player_Left_Item          = "L: ";

            for (int i = 0; i < prices.Length; i++)
            {
                if (prices[i].active)
                {
                    sb.DrawString(Game1.tenbyFive14, prices[i].price.ToString(), prices[i].position - parent.CameraFocus.Position + new Vector2(GlobalGameConstants.GameResolutionWidth / 2, GlobalGameConstants.GameResolutionHeight / 2), Color.LightBlue);
                }
            }

            //draw a black 1px outline over the GUI font

            for (int i = -1; i < 2; i++)
            {
                for (int j = -1; j < 2; j++)
                {
                    if (i == 0 || j == 0)
                    {
                        continue;
                    }

                    Vector2 offset = new Vector2(i, j);
                    //sb.DrawString(Game1.font, player_health_display, , Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                    medAnim.drawAnimationFrame(0.0f, sb, new Vector2(140, 80) + offset, new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                    //sb.DrawString(Game1.font, ammunition_amount_display, new Vector2(140, 110) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                    ammoAnim.drawAnimationFrame(0.0f, sb, new Vector2(140, 110) + offset, new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                    coinAnim.drawAnimationFrame(0.0f, sb, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 70) - new Vector2(Game1.font.MeasureString(coin_amount_display).X, 0) / 2 + offset, new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                    sb.DrawString(Game1.font, coin_amount_display, new Vector2(GlobalGameConstants.GameResolutionWidth / 2 + 32, 70) - new Vector2(Game1.font.MeasureString(coin_amount_display).X, 0) / 2 + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                    sb.DrawString(Game1.font, Player_Right_Item, new Vector2(245, 140) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                    sb.DrawString(Game1.font, Player_Left_Item, new Vector2(160, 140) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);

                    player_second_weapon.drawAnimationFrame(0.0f, sb, new Vector2(180, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.Black);
                    player_first_weapon.drawAnimationFrame(0.0f, sb, new Vector2(265, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.Black);

                    if (GameCampaign.IsATwoPlayerGame)
                    {
                        //sb.DrawString(Game1.font, player_health_display, new Vector2(955, 80) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                        medAnim.drawAnimationFrame(0.0f, sb, new Vector2(945, 80) + offset, new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                        //sb.DrawString(Game1.font, ammunition_amount_display, new Vector2(955, 110) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                        ammoAnim.drawAnimationFrame(0.0f, sb, new Vector2(945, 110) + offset, new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                        sb.DrawString(Game1.font, Player_Right_Item, new Vector2(1057, 140) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
                        sb.DrawString(Game1.font, Player_Left_Item, new Vector2(972, 140) + offset, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);

                        player2_second_weapon.drawAnimationFrame(0.0f, sb, new Vector2(1070 + 16, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.Black);
                        player2_first_weapon.drawAnimationFrame(0.0f, sb, new Vector2(980 + 16, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.Black);
                    }
                }
            }

            // allegiance meter
            sb.Draw(Game1.healthBar, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2, 0), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);
            sb.Draw(Game1.greyBar, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2, 0) + new Vector2(5, 0), null, Color.Orange, 0.0f, Vector2.Zero, new Vector2((1 - GameCampaign.PlayerAllegiance) * 160f, 1), SpriteEffects.None, 0.51f);
            sb.Draw(Game1.greyBar, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2, 0) + new Vector2(5 + ((1 - GameCampaign.PlayerAllegiance) * 160f), 0), null, Color.Cyan, 0.0f, Vector2.Zero, new Vector2(GameCampaign.PlayerAllegiance * 160f, 1), SpriteEffects.None, 0.51f);

            sb.Draw(Game1.whitePixel, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2, 0) + new Vector2((float)(5 + ((1 - guardBarPosition) * 160.0)), 0), null, Color.White, 0.0f, Vector2.Zero, new Vector2(5, 16), SpriteEffects.None, 0.53f);
            sb.Draw(Game1.whitePixel, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2, 0) + new Vector2((float)(5 + ((1 - prisonerBarPosition) * 160.0)), 0), null, Color.White, 0.0f, Vector2.Zero, new Vector2(5, 16), SpriteEffects.None, 0.53f);

            sb.Draw(Game1.energyOverlay, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2, 0), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.52f);
            sb.Draw(Game1.prisonerIcon, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) - new Vector2(Game1.healthBar.Width / 2 + 32, 20), null, prisonerColor, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);
            sb.Draw(Game1.guardIcon, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 100) + new Vector2(Game1.healthBar.Width / 2 + 12, -12), null, guardColor, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);

            if (GameCampaign.change_guard_icon_color)
            {
                if (guardBarPosition >= GameCampaign.PlayerAllegiance)
                {
                    guardBarPosition      = GameCampaign.PlayerAllegiance;
                    guardBarPositionReset = false;
                }
                else
                {
                    if (!guardBarPositionReset)
                    {
                        guardBarPosition      = 0.0f;
                        guardBarPositionReset = true;
                    }
                    else
                    {
                        guardBarPosition += 0.01f;
                    }
                }
            }
            else
            {
                guardBarPosition = GameCampaign.PlayerAllegiance;
            }

            if (GameCampaign.change_prisoner_icon_color)
            {
                if (prisonerBarPosition <= GameCampaign.PlayerAllegiance)
                {
                    prisonerBarPosition      = GameCampaign.PlayerAllegiance;
                    prisonerBarPositionReset = false;
                }
                else
                {
                    if (!prisonerBarPositionReset)
                    {
                        prisonerBarPosition      = 1.0f;
                        prisonerBarPositionReset = true;
                    }
                    else
                    {
                        prisonerBarPosition -= 0.01f;
                    }
                }
            }
            else
            {
                prisonerBarPosition = GameCampaign.PlayerAllegiance;
            }
            //player 1 GUI
            medAnim.drawAnimationFrame(0.0f, sb, new Vector2(140, 80), new Vector2(0.75f), 0.51f, 0.0f, Vector2.Zero, Color.White);
            sb.Draw(Game1.healthBar, new Vector2(167, 85), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);
            sb.Draw(Game1.healthColor, new Vector2(172, 85), null, Color.White, 0.0f, Vector2.Zero, new Vector2(GameCampaign.Player_Health * 1.6f, 1), SpriteEffects.None, 0.51f);
            sb.Draw(Game1.energyOverlay, new Vector2(167, 85), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.52f);

            ammoAnim.drawAnimationFrame(0.0f, sb, new Vector2(140, 110), new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
            sb.Draw(Game1.healthBar, new Vector2(167, 113), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);
            sb.Draw(Game1.energyColor, new Vector2(172, 113), null, Color.White, 0.0f, Vector2.Zero, new Vector2(GameCampaign.Player_Ammunition * 1.6f, 1), SpriteEffects.None, 0.51f);
            sb.Draw(Game1.energyOverlay, new Vector2(167, 113), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.52f);

            coinAnim.drawAnimationFrame(0.0f, sb, new Vector2(GlobalGameConstants.GameResolutionWidth / 2, 70) - new Vector2(Game1.font.MeasureString(coin_amount_display).X, 0) / 2, new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);
            sb.DrawString(Game1.font, coin_amount_display, new Vector2(GlobalGameConstants.GameResolutionWidth / 2 + 32, 70) - new Vector2(Game1.font.MeasureString(coin_amount_display).X, 0) / 2, Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);

            sb.DrawString(Game1.font, Player_Right_Item, new Vector2(245, 140), textColor, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.51f);
            player_first_weapon.drawAnimationFrame(0.0f, sb, new Vector2(265, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);

            sb.DrawString(Game1.font, Player_Left_Item, new Vector2(160, 140), textColor, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.51f);
            player_second_weapon.drawAnimationFrame(0.0f, sb, new Vector2(180, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);

            if (GameCampaign.IsATwoPlayerGame)
            {
                medAnim.drawAnimationFrame(0.0f, sb, new Vector2(945, 80), new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                sb.Draw(Game1.healthBar, new Vector2(972, 83), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);
                sb.Draw(Game1.healthColor, new Vector2(977, 83), null, Color.White, 0.0f, Vector2.Zero, new Vector2(GameCampaign.Player2_Health * 1.6f, 1), SpriteEffects.None, 0.51f);
                sb.Draw(Game1.energyOverlay, new Vector2(972, 83), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.52f);

                ammoAnim.drawAnimationFrame(0.0f, sb, new Vector2(945, 110), new Vector2(0.75f), 0.5f, 0.0f, Vector2.Zero, Color.White);
                sb.Draw(Game1.healthBar, new Vector2(972, 113), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.5f);
                sb.Draw(Game1.energyColor, new Vector2(977, 113), null, Color.White, 0.0f, Vector2.Zero, new Vector2(GameCampaign.Player2_Ammunition * 1.6f, 1), SpriteEffects.None, 0.51f);
                sb.Draw(Game1.energyOverlay, new Vector2(972, 113), null, Color.White, 0.0f, Vector2.Zero, new Vector2(1, 1), SpriteEffects.None, 0.52f);

                sb.DrawString(Game1.font, Player_Left_Item, new Vector2(972, 140), text2Color, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.51f);
                player2_first_weapon.drawAnimationFrame(0.0f, sb, new Vector2(980 + 16, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);

                sb.DrawString(Game1.font, Player_Right_Item, new Vector2(1057, 140), text2Color, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.51f);
                player2_second_weapon.drawAnimationFrame(0.0f, sb, new Vector2(1070 + 16, 140), new Vector2(1.0f), 0.5f, 0.0f, Vector2.Zero, Color.White);
            }

            /*sb.Draw(Game1.whitePixel, new Vector2(499, 31), null, Color.Black, 0.0f, Vector2.Zero, new Vector2(66, 26), SpriteEffects.None, 0.0f);
             * sb.Draw(Game1.whitePixel, new Vector2(500, 32), null, Color.Orange, 0.0f, Vector2.Zero, new Vector2(64 * (1 - GameCampaign.PlayerAllegiance), 24), SpriteEffects.None, 0.0f);
             * sb.Draw(Game1.whitePixel, new Vector2(500 + (64 * (1 - GameCampaign.PlayerAllegiance)), 32), null, Color.LightBlue, 0.0f, Vector2.Zero, new Vector2(64 * GameCampaign.PlayerAllegiance, 24), SpriteEffects.None, 0.0f);
             *
             * for (int i = 0; i < windowIsActive.Length; i++)
             * {
             *  if (!windowIsActive[i])
             *  {
             *      continue;
             *  }
             *
             *  drawBox(ref boxWindows[i], sb);
             * }
             *
             * for (int i = 0; i < parent.KeyModule.NumberOfKeys; i++)
             * {
             *  if (parent.KeyModule.isKeyFound((LevelKeyModule.KeyColor)i))
             *  {
             *      keyFoundPic.drawAnimationFrame(0.0f, sb, new Vector2(600 + (i * 49), 10), new Vector2(3.0f, 3.0f), 0.5f, parent.KeyModule.KeyColorSet[i]);
             *  }
             *  else
             *  {
             *      keyNotFoundPic.drawAnimationFrame(0.0f, sb, new Vector2(600 + (i * 49), 10), new Vector2(3.0f, 3.0f), 0.5f, parent.KeyModule.KeyColorSet[i]);
             *  }
             * }*/

            if (parent.RenderNodeMap && !parent.Player1Dead)
            {
                Vector2 renderMapPosition = new Vector2(GlobalGameConstants.GameResolutionWidth / 2 - (parent.NodeMap.GetLength(0) * 64 / 2), GlobalGameConstants.GameResolutionHeight / 4);
                int     renderFocusX      = (int)((parent.CameraFocus.CenterPoint.X / GlobalGameConstants.TileSize.X) / GlobalGameConstants.TilesPerRoomWide);
                int     renderFocusY      = (int)((parent.CameraFocus.CenterPoint.Y / GlobalGameConstants.TileSize.Y) / GlobalGameConstants.TilesPerRoomHigh);

                sb.Draw(mapIcon, renderMapPosition - (new Vector2(100)) / 2, Color.White);

                int   mapResolution = 2;
                float mapScale      = 2.5f;
                for (int i = 0; i < parent.Map.Map.GetLength(0); i += mapResolution)
                {
                    for (int j = 0; j < parent.Map.Map.GetLength(1); j += mapResolution)
                    {
                        if (parent.Map.Map[i, j] == TileMap.TileType.NoWall)
                        {
                            sb.Draw(Game1.whitePixel, renderMapPosition + new Vector2(i, j) * mapScale, null, Color.Lerp(Color.Cyan, Color.LightCyan, (float)(Math.Sin(flickerTime / 1000f))), 0.0f, Vector2.Zero, new Vector2(mapResolution) * mapScale, SpriteEffects.None, 0.5f);
                        }
                    }
                }

                Vector2 playerPos = parent.CameraFocus.Position / parent.Map.SizeInPixels;
                sb.Draw(Game1.whitePixel, renderMapPosition + new Vector2(300) * playerPos, null, Color.Red, 0.0f, Vector2.Zero, new Vector2(mapResolution) * mapScale, SpriteEffects.None, 0.5f);
            }

            sb.Draw(Game1.whitePixel, Vector2.Zero, null, Color.Lerp(Color.Transparent, Color.Black, blackFadeOverlay), 0.0f, Vector2.Zero, new Vector2(GlobalGameConstants.GameResolutionWidth, GlobalGameConstants.GameResolutionHeight), SpriteEffects.None, 0.5f);

            if (playerOutOfSight)
            {
                sb.Draw(Game1.p2Icon, new Vector2((float)(((GlobalGameConstants.GameResolutionWidth) * 0.15 * Math.Cos(playerOutOfSightAngle))) + (GlobalGameConstants.GameResolutionWidth / 2), (float)(((GlobalGameConstants.GameResolutionWidth) * 0.15 * Math.Sin(playerOutOfSightAngle)) + (GlobalGameConstants.GameResolutionHeight / 2))), new Rectangle(0, 0, 96, 48), Color.White, playerOutOfSightAngle, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);
            }

            if (parent.Player1Dead)
            {
                sb.DrawString(Game1.tenbyFive72, deathMessage, (new Vector2(GlobalGameConstants.GameResolutionWidth, GlobalGameConstants.GameResolutionHeight) - Game1.tenbyFive72.MeasureString(deathMessage)) / 2, Color.LightGray);
            }
        }
Example #16
0
 public override void draw(Spine.SkeletonRenderer sb)
 {
     keyGraphic.drawAnimationFrame(0.0f, sb, position, new Vector2(3), 0.5f, 0.0f, Vector2.Zero, parentWorld.KeyModule.KeyColorSet[(int)color]);
 }