Ejemplo n.º 1
0
 public frmMainCombat()
 {
     InitializeComponent();
     bLog = new BattleLog();
     BattleTimer.Start();
     bLog.addLog("I live once more...");
 }
Ejemplo n.º 2
0
 private void BattleForceButton_Click(object sender, EventArgs e)
 {
     timeLeft             = 0;
     timeLabel.Text       = timeLeft.ToString();
     BattleTimer.Interval = 1000;
     BattleTimer.Start();
 }
Ejemplo n.º 3
0
 void Start()
 {
     player        = GetComponent <Player>();
     playerInput   = GetComponent <PlayerInput>();
     battleManager = BattleManagerUtils.BattleManager.instance;
     battleTimer   = BattleManagerUtils.BattleManager.BattleTimer;
 }
Ejemplo n.º 4
0
    public static BattleTimer Instance()
    {
        if (mBattleTimer == null)
        {
            mBattleTimer = new BattleTimer();
        }

        return mBattleTimer;
    }
Ejemplo n.º 5
0
        public void Start()
        {
            if (!IsReady)
            {
                return;
            }

            foreach (var session in Session)
            {
                Commands.Add(session.EndPoint, new Queue <byte[]>());
            }

            StartTime = DateTime.UtcNow;
            BattleTimer.Start();
        }
Ejemplo n.º 6
0
        private void BattleStartButton_Click(object sender, EventArgs e)
        {
            if (timeLabel.Text != "Off")
            {
                BattleTimer.Stop();
                timeLabel.Text = "Off";
                return;
            }

            if (timeLeft == 0)
            {
                timeLeft       = randomizer.Next(min, max);
                timeLabel.Text = timeLeft.ToString();
            }
            BattleTimer.Interval = 1000;
            BattleTimer.Start();
        }
Ejemplo n.º 7
0
        private async void BattleTimer_Tick(object sender, EventArgs e)
        {
            if (timeLeft > 0)
            {
                timeLeft       = timeLeft - 1;
                timeLabel.Text = timeLeft.ToString();
                return;
            }

            BattleTimer.Stop();
            int random = randomizer.Next(10);

            switch (random)
            {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
                timeLabel.Text = "zombie";
                await ZombieRun();

                break;

            case 6:
            case 7:
            case 8:
                timeLabel.Text = "rat";
                await RatRun();

                break;

            case 9:
            default:
                timeLabel.Text = "skeleton";
                await SkeletonRun();

                break;
            }

            timeLeft = randomizer.Next(min, max);
            BattleTimer.Start();
        }
Ejemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     battleTimer = transform.root.GetComponent<BattleTimer> ();
     bar = GetComponent<Image> ();
 }
Ejemplo n.º 9
0
 public void Stop()
 {
     BattleTimer.Stop();
     Resources.Sessions.Remove(Session.Id);
 }
Ejemplo n.º 10
0
 private void Awake()
 {
     instance = this;
 }