Предыдущая Следующая
}
// Обрабатываем нажатие левой кнопкой мыши if(mouseState.LeftButton == ButtonState.Pressed && bbMouse.Intersects(bbCursorGame))
{
level = 1;
this.NewGame(level); menuState = false; levelState = false; gameState = true;
}
else if(mouseState.LeftButton == ButtonState.Pressed && bbMouse.Intersects(bbCursorExit))
{
this.Exit();
/// <summary>
/// Продолжение игры
/// <summary>
public void LevelSelect()
{
if (keyboardState.IsKeyDown(Keys.A))
{
this.NewGame(level); menuState = false; levelState = false; gameState = true;
if(keyboardState.IsKeyDown(Keys.B))
{
menuState = true; levelState = false; gameState = false;
}
if (keyboardState.IsKeyDown(Keys.Escape))
{
this.Exit();
}
}
/// <summary>
/// Рисуем на экране
/// <summary>
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue); if(menuState == true)
{
spriteBatch.Begin(SpriteBlendMode.AlphaBlend); menu.DrawMenu(spriteBatch, cursorState); mouse.DrawSprite(spriteBatch); spriteBatch.End();
}
else if(levelState == true)
{
spriteBatch.Begin(SpriteBlendMode.AlphaBlend); menu.DrawMenu(spriteBatch, 3);
spriteBatch.Draw(gameLevel, new Vector2(300, 220),
Color.White);;
spriteBatch.End();
int f = 320;
if (tempLevel == 8)
{
font.DrawString(440, f, Color.Black, "Вы победили!!!");
}
font.DrawString(420, £, Со1ог.Б1аск, "Продолжение игры");
font.DrawString(420, f += font.LineHeight, "Вы прошли уровень");
^п1^га\^1^пд(500, f += font.LineHeight, "{0}", tempLeve1);
font.DrawString(430, f += font.LineHeight + 35, "Набранные очки");
font.DrawString(4 90, f += font.LineHeight, "{0}", tota1Score);
font.DrawString(440, f += font.LineHeight, "Нужно очков");
font.DrawString(4 90, f += font.LineHeight , "{0}", endScore);
font.DrawString(415, f += font.LineHeight, "Следующий уровень");
234 Добавляем в игру новые уровни
font.DrawString^OO, f += font.LineHeight, "і0>", level); else if(gameState == true)
і
spriteBatch.Begin(SpriteBlendMode.AlphaBlend); spriteBatch.Draw(backgroundl, new Vector2(0, 0), Color.White);
for (int i = 0; sprite.Length > i;
і
sprite[i].DrawAnimationSprite(spriteBatch);
}
spriteBatch.Draw(background2, new Vector2(0, 0), Color.White);
platform.DrawSprite(spriteBatch); spriteBatch.End();
if(paused == true)
і
spriteBatch.Begin(SpriteBlendMode.AlphaBlend); spriteBatch.Draw(pausedTexture, new Vector2(300, 300), Color.White); spriteBatch.End(); Предыдущая Следующая
|