Пример #1
0
        public override void Draw2()
        {
            //if(SK.orientation <= 2) {
            //    spriteBatch.Draw(SK.texture_background_grid32, SK.Position_DisplayEdge() + SK.Position_BackgroundGrid() + new Vector2(32, 0), Color.White);
            //} else {
            //    spriteBatch.Draw(SK.texture_background_grid32, SK.Position_DisplayEdge() + SK.Position_BackgroundGrid() + new Vector2(0, 32), Color.White);
            //}

            spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_CoinPos(0), new Rectangle(0, 0, 32, 32), new Color(255, 255, 225), 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_CoinPos(1), new Rectangle(0, 0, 32, 32), new Color(255, 225, 225), 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_CoinPos(2), new Rectangle(0, 0, 32, 32), new Color(225, 255, 225), 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_CoinPos(3), new Rectangle(0, 0, 32, 32), new Color(225, 225, 255), 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_CoinPos(4), new Rectangle(0, 0, 32, 32), new Color(255, 255, 255), 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);

            spriteBatch.Draw(SK.texture_spritesheet_octanom_head, SK.Position_DisplayEdge() + SK.Position_Grid32() + octanom_head.Get_GridPos(SK.orientation), new Rectangle(0, octanom_head.Get_LookDirection(SK.orientation) * 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);

            foreach (Entity tail in octanom_tail)
            {
                spriteBatch.Draw(SK.texture_spritesheet_octanom_tail, SK.Position_DisplayEdge() + SK.Position_Grid32() + tail.Get_GridPos(SK.orientation), new Rectangle(0, tail.Get_LookDirection(SK.orientation) * 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            }
        }
Пример #2
0
        public override void Draw2()
        {
            spriteBatch.Draw(SK.texture_background_grid32, SK.Position_DisplayEdge() + SK.Position_BackgroundGrid(), Color.White);

            for (int x = 0; x < 28; x++)
            {
                for (int y = 0; y < 23; y++)
                {
                    if (grid_main[x, y])
                    {
                        spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_GridPos(x, y), new Rectangle(0, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    }
                    if (grid_points[x, y])
                    {
                        spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_GridPos(x, y), new Rectangle(0, 64, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    }
                    if (grid_power[x, y])
                    {
                        spriteBatch.Draw(SK.texture_spritesheet_coin, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_GridPos(x, y), new Rectangle(0, 32, 32, 32), Color.LightBlue, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    }
                }
            }

            Color color = Color.White;

            if (powerup)
            {
                color = Color.Blue;
            }

            if (!active_gameover)
            {
                spriteBatch.Draw(SK.texture_spritesheet_octanom_head, SK.Position_DisplayEdge() + SK.Position_Grid32() + octanom.Get_GridPos(SK.orientation), new Rectangle(0, octanom.Get_LookDirection(SK.orientation) * (32), 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            }
            spriteBatch.Draw(SK.texture_spritesheet_trianom, SK.Position_DisplayEdge() + SK.Position_Grid32() + trianom[0].Get_GridPos(SK.orientation), new Rectangle(0, trianom[0].Get_LookDirection(SK.orientation) * (32), 32, 32), color, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_trianom, SK.Position_DisplayEdge() + SK.Position_Grid32() + trianom[1].Get_GridPos(SK.orientation), new Rectangle(0, trianom[1].Get_LookDirection(SK.orientation) * (32), 32, 32), color, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_trianom, SK.Position_DisplayEdge() + SK.Position_Grid32() + trianom[2].Get_GridPos(SK.orientation), new Rectangle(0, trianom[2].Get_LookDirection(SK.orientation) * (32), 32, 32), color, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
            spriteBatch.Draw(SK.texture_spritesheet_trianom, SK.Position_DisplayEdge() + SK.Position_Grid32() + trianom[3].Get_GridPos(SK.orientation), new Rectangle(0, trianom[3].Get_LookDirection(SK.orientation) * (32), 32, 32), color, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);

            for (int x = 0; x < 28; x++)
            {
                for (int y = 0; y < 23; y++)
                {
                    if (grid_gate[x, y])
                    {
                        spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_GridPos(x, y), new Rectangle(32, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    }
                    if (position_octanom_start == new Vector2(x, y))
                    {
                        spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_GridPos(x, y), new Rectangle(64, 32, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    }
                    if (position_trianom_start == new Vector2(x, y))
                    {
                        spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + Get_GridPos(x, y), new Rectangle(96, 32, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    }
                }
            }

            foreach (Entity E in explosions)
            {
                spriteBatch.Draw(SK.texture_spritesheet_explosion, SK.Position_DisplayEdge() + SK.Position_Grid32() + E.Get_GridPos(SK.orientation) - new Vector2(16), new Rectangle(1 + E.Get_HP() / 2 + (64 * (E.Get_HP() / 2)), 1, 64, 64), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                E.Change_HP(1);
            }
        }
Пример #3
0
 public override void Draw2()
 {
     for (int x = 0; x < 16; x++)
     {
         for (int y = 0; y < 12; y++)
         {
             if (grid_field[x, y] == 1)
             {
                 spriteBatch.Draw(SK.texture_background_grid32, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(6 * 32, 5 * 32) + new Vector2(32 * x, 32 * y), new Rectangle(0, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
             }
             if (grid_field[x, y] == 2)
             {
                 spriteBatch.Draw(SK.texture_background_grid32, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(6 * 32, 5 * 32) + new Vector2(32 * x, 32 * y), new Rectangle(32, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
             }
             if (grid_main [x, y])
             {
                 spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(6 * 32, 5 * 32) + new Vector2(32 * x, 32 * y), new Rectangle(32, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
             }
         }
     }
     foreach (Entity c in crate)
     {
         spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(6 * 32, 5 * 32) + c.Get_GridPos(), new Rectangle(0, 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
     }
     foreach (Entity c in cross)
     {
         spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(6 * 32, 5 * 32) + c.Get_GridPos(), new Rectangle(32, 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
     }
     spriteBatch.Draw(SK.texture_spritesheet_octanom_head, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(6 * 32, 5 * 32) + octanom.Get_GridPos(), new Rectangle(0, octanom.Get_LookDirection() * 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
 }
Пример #4
0
        public override string Update3(GameTime gameTime)
        {
            if (!active_pause && !active_gameover && !FM.active_transition)
            {
                octanom.Update(powerup);
                Command_Move_Octanom(gameTime);

                for (int i = 0; i < 4; i++)
                {
                    string sa = Command_Move_Trianom(trianom[i]);
                    if (sa == "up")
                    {
                        if (trianom[i].Get_Next().Y == 0)
                        {
                            trianom[i].Set_Next(new Vector2(trianom[i].Get_Next().X, 21)); trianom[i].Set_Pos(trianom[i].Get_Pos().X, SK.Position_Grid32().Y + 32 * 23);
                        }
                        else
                        {
                            trianom[i].Set_Next(new Vector2(trianom[i].Get_Next().X, trianom[i].Get_Next().Y - 1));
                        }
                    }
                    if (sa == "down")
                    {
                        if (trianom[i].Get_Next().Y == 21)
                        {
                            trianom[i].Set_Next(new Vector2(trianom[i].Get_Next().X, 0)); trianom[i].Set_Pos(trianom[i].Get_Pos().X, SK.Position_Grid32().Y - 32);
                        }
                        else
                        {
                            trianom[i].Set_Next(new Vector2(trianom[i].Get_Next().X, trianom[i].Get_Next().Y + 1));
                        }
                    }
                    if (sa == "left")
                    {
                        if (trianom[i].Get_Next().X == 0)
                        {
                            trianom[i].Set_Next(new Vector2(27, trianom[i].Get_Next().Y)); trianom[i].Set_Pos(SK.Position_Grid32().X + 32 * 28, trianom[i].Get_Pos().Y);
                        }
                        else
                        {
                            trianom[i].Set_Next(new Vector2(trianom[i].Get_Next().X - 1, trianom[i].Get_Next().Y));
                        }
                    }
                    if (sa == "right")
                    {
                        if (trianom[i].Get_Next().X == 27)
                        {
                            trianom[i].Set_Next(new Vector2(0, trianom[i].Get_Next().Y)); trianom[i].Set_Pos(SK.Position_Grid32().X - 32, trianom[i].Get_Pos().Y);
                        }
                        else
                        {
                            trianom[i].Set_Next(new Vector2(trianom[i].Get_Next().X + 1, trianom[i].Get_Next().Y));
                        }
                    }
                    trianom[i].Update();
                    Command_Collision(trianom[i]);
                }

                bool temp_break = false;;
                for (int x = 0; x < 28; x++)
                {
                    for (int y = 0; y < 22; y++)
                    {
                        if (grid_points[x, y])
                        {
                            temp_break = true;
                            break;
                        }
                    }
                    if (temp_break)
                    {
                        break;
                    }
                }
                if (!temp_break)
                {
                    JK.Noise("Cleared");
                    Restart();
                }

                if (gameTime.TotalGameTime.TotalMilliseconds > powerup_timer_start + powerup_timer_break && powerup)
                {
                    powerup         = false;
                    score_power_hit = 1;
                }
            }

            if (score_lives <= 0)
            {
                GameOver(gameTime.TotalGameTime.TotalSeconds);
            }

            foreach (Entity e in explosions)
            {
                if (e.Get_HP() > 15)
                {
                    explosions.Remove(e);
                    break;
                }
            }
            return("void");
        }
Пример #5
0
        public override void Draw2()
        {
            spriteBatch.Draw(SK.texture_background_grid32, SK.Position_DisplayEdge() + SK.Position_BackgroundGrid(), Color.White);
            if (SK.orientation <= 2)
            {
                for (int x = 0; x < 28; x++)
                {
                    for (int y = 0; y < 23; y++)
                    {
                        if (field[y] == 0)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(32 * x, 32 * y), new Rectangle(32 * 2, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                        if (field[y] == 1)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(32 * x, 32 * y), new Rectangle(32 * 3, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                        if (field[y] == 2)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(32 * x, 32 * y), new Rectangle(32 * 4, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                    }
                }
                foreach (Entity c in lilypad)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_octanom_tail, SK.Position_DisplayEdge() + SK.Position_Grid32() + c.Get_Pos(), new Rectangle(0, 0, 32, 32), Color.LightGreen, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }
                foreach (Entity c in crate)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + c.Get_Pos(), new Rectangle(0, 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }

                if (octanom.Get_HP() > 0)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_octanom_head, SK.Position_DisplayEdge() + SK.Position_Grid32() + octanom.Get_Pos(), new Rectangle(0, octanom.Get_LookDirection() * (32), 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }

                foreach (Entity c in trianom)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_trianom, SK.Position_DisplayEdge() + SK.Position_Grid32() + c.Get_Pos(), new Rectangle(0, c.Get_LookDirection() * (32), 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }

                foreach (Entity E in explosions)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_explosion, SK.Position_DisplayEdge() + SK.Position_Grid32() + E.Get_Pos() - new Vector2(16), new Rectangle(1 + E.Get_HP() + (64 * (E.Get_HP() / 2)), 1, 64, 64), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    E.Change_HP(1);
                }
            }
            else
            {
                for (int x = 0; x < 28; x++)
                {
                    for (int y = 0; y < 23; y++)
                    {
                        if (field[y] == 0)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(32 * y, 32 * (27 - x)), new Rectangle(32 * 2, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                        if (field[y] == 1)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(32 * y, 32 * (27 - x)), new Rectangle(32 * 3, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                        if (field[y] == 2)
                        {
                            spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(32 * y, 32 * (27 - x)), new Rectangle(32 * 4, 0, 32, 32), Color.WhiteSmoke, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                        }
                    }
                }
                foreach (Entity c in lilypad)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_octanom_tail, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(c.Get_Pos().Y, 27 * 32 - c.Get_Pos().X), new Rectangle(0, 0, 32, 32), Color.LightGreen, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }
                foreach (Entity c in crate)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_octagames, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(c.Get_Pos().Y, 27 * 32 - c.Get_Pos().X), new Rectangle(0, 32, 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }

                if (octanom.Get_HP() > 0)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_octanom_head, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(octanom.Get_Pos().Y, 27 * 32 - octanom.Get_Pos().X), new Rectangle(0, octanom.Get_LookDirection() * (32), 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }

                foreach (Entity c in trianom)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_trianom, SK.Position_DisplayEdge() + SK.Position_Grid32() + new Vector2(c.Get_Pos().Y, 27 * 32 - c.Get_Pos().X), new Rectangle(0, c.Get_LookDirection() * (32), 32, 32), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                }

                foreach (Entity E in explosions)
                {
                    spriteBatch.Draw(SK.texture_spritesheet_explosion, SK.Position_DisplayEdge() + new Vector2(E.Get_Pos().Y - 16, E.Get_Pos().X - 16 - 27 * 32), new Rectangle(1 + E.Get_HP() + (64 * (E.Get_HP() / 2)), 1, 64, 64), Color.White, 0.0f, new Vector2(0, 0), 1, SpriteEffects.None, 0.0f);
                    E.Change_HP(1);
                }
            }
        }