lostorwin.cs

来自「嵌入式程序」· CS 代码 · 共 51 行

CS
51
字号
using System;
using DiamondPet.UserLayer;

namespace DiamondPet.LogicLayer.GameStateRunLogic.Pause
{
	/// <summary>
	/// LostOrWin 的摘要说明。
	/// 输赢状态
	/// </summary>
	public class LostOrWin : Pause
	{
		/// <summary>
		/// 图片有效时间
		/// </summary>
		private int liveTime;

		public LostOrWin()
		{}

		public LostOrWin(RunStateManager r) : base(r)
		{
			liveTime = 100;
		}

		#region 游戏主循环

		public override void RunStateLogic()
		{
			Draw.DrawImage(Pictures.picturesImage[GameConstResource.gameOverPic],
                      GameConstResource.gameOverPosX,
				      GameConstResource.gameOverPosY,
			          Pictures.picturesImage[GameConstResource.gameOverPic].Width,
                      Pictures.picturesImage[GameConstResource.gameOverPic].Height,
				      0,0,
                      Pictures.picturesImage[GameConstResource.gameOverPic].Width,
                      Pictures.picturesImage[GameConstResource.gameOverPic].Height);

			if(--liveTime <= 0)
			{
				this.runStateManager.userLayerStateManager.diamondPet.hs.AddNewScore
					(this.runStateManager.gameDate.gameScore.Score);
				this.runStateManager.userLayerStateManager.AnotherChangeState
					(UserLayerStateManager.GAMESTATESTART);
			}

		}
		#endregion

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?