コード例 #1
0
        private void 멈추기SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MoveTimer.Enabled)
            {
                toolStop.Text = "움직이기(&S)";
                if (hling == null)
                {
                    hling = new Thread(new ThreadStart(Howling));
                    hling.Start();
                }
                else
                {
                    hling.Abort();
                    hling = new Thread(new ThreadStart(Howling));
                    hling.Start();
                }

                MoveTimer.Stop();
            }
            else
            {
                toolStop.Text = "멈추기(&S)";
                MoveTimer.Start();
            }


            if (dir != 4)
            {
                dir = 4;
            }
            else
            {
                dir = 0;
            }
        }
コード例 #2
0
ファイル: TrayBalloonFrm.cs プロジェクト: LegendForAll/Mai
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!UseOpacity)
            {
                Opacity = 1;
            }

            SetupText();

            //Width = 200;
            //Height = 60;
            Width  = 400;
            Height = 100;
            //Location = new Point(
            //    Screen.PrimaryScreen.Bounds.Width - Width,
            //    Screen.PrimaryScreen.Bounds.Height - Height * (1 + StartingOffsetIndex) + ((StartingOffsetIndex == 0) ? 0 : (Screen.PrimaryScreen.WorkingArea.Height - Screen.PrimaryScreen.Bounds.Height)));

            OpacityStep = (float)(((float)SystemInformation.WorkingArea.Height / (float)SystemInformation.VirtualScreen.Height) / 10.0);

            MoveTimer.Start();

            Play(SoundLocation);
        }
コード例 #3
0
 public static void Pause()
 {
     MoveTimer.Stop();
     GenCarTimer.Stop();
     WorkTimer.Stop();
     LightsTimer.Stop();
 }
コード例 #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_Timer = new MoveTimer(this);
        }
コード例 #5
0
        public async Task <bool> Run()
        {
            if (MoveTimer.IsFinished && (Poi.Current != null && Poi.Current.Type != PoiType.None))
            {
                var path = StraightPathHelper.RealStraightPath();
                Logger.Info($"Dump path:");
                foreach (var x in path)
                {
                    Logger.Info(x.ToString());
                }

                Logger.Warn("No activity was detected for {0} seconds. Clearing POI and trying again.", MoveTimer.WaitTime.TotalSeconds);
                Poi.Clear("No activity detected");
                MoveTimer.Reset();
                return(true);
            }
            else if (MoveTimer.IsFinished)
            {
                Logger.Warn("No activity was detected for {0} seconds. Clearing Navigator?", MoveTimer.WaitTime.TotalSeconds);
                await CommonTasks.StopMoving();

                Navigator.Clear();
                MoveTimer.Reset();
                return(true);
            }

            return(false);
        }
コード例 #6
0
        private void Gameover()
        {
            vreme.Stop();
            SpawnTimer.Stop();
            MoveTimer.Stop();
            ReduceSpeed.Stop();
            GameOver     go  = new GameOver(lbScore.Text);
            DialogResult res = go.ShowDialog();

            if (res == System.Windows.Forms.DialogResult.Retry)
            {
                veg.Clear();
                score        = 0;
                lbTime.Text  = "60";
                lbScore.Text = "0";
                vreme.Start();
                SpawnTimer.Start();
                MoveTimer.Start();
                pb1.Visible = true;
                pb2.Visible = true;
                pb3.Visible = true;
                canvas.Invalidate();
                SpawnTimer.Interval = 10;
                progress.Value      = 60;
                isPressed           = false;
                ReduceSpeed.Start();
            }
        }
コード例 #7
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Form.Closed" /> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs" /> that contains the event data.</param>
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            CloseTimer.Stop();
            MoveTimer.Stop();
        }
コード例 #8
0
ファイル: Shell.cs プロジェクト: Isgeny/BattleCity
 public override void Unsubscribe()
 {
     GUIForm.Paint  -= OnPaint;
     MoveTimer.Tick -= OnMoveTimerTick;
     MoveTimer.Stop();
     Destroyed -= OnDestroyed;
 }
コード例 #9
0
ファイル: Shell.cs プロジェクト: Isgeny/BattleCity
 public override void Subscribe()
 {
     GUIForm.Paint  += OnPaint;
     MoveTimer.Tick += OnMoveTimerTick;
     MoveTimer.Start();
     Destroyed += OnDestroyed;
 }
コード例 #10
0
        public GameBoard()
        {
            InitializeComponent();
            KeyDown += new KeyEventHandler(GameBoard_KeyDown);

            MoveTimer.Interval = 100;
            MoveTimer.Start();
        }
コード例 #11
0
        public void MakeMove(Point move)
        {
            SetLookDirectionToPlayer();
            MoveTimer.Restart();
            var newLocation = Location + (Size)move;

            Game.Map[Location.Y, Location.X] = State.Empty;
            Location = newLocation;
            Game.Map[Location.Y, Location.X] = State.Enemy;
        }
コード例 #12
0
 public override void SetNewStageParameters()
 {
     MoveToStartPosition();
     Dx        = 0;
     Dy        = 0;
     Direction = Direction.Up;
     Immortal  = false;
     MoveTimer.Stop();
     RespawnTimer.Start();
 }
コード例 #13
0
 public Bear()
 {
     InitializeComponent();
     LoadImage();
     MoveTimer.Interval = 500;
     MoveTimer.Start();
     this.AllowDrop  = true;
     this.DragEnter += new DragEventHandler(Form1_DragEnter);
     this.DragDrop  += new DragEventHandler(Form1_DragDrop);
 }
コード例 #14
0
 public static void Start()
 {
     MoveTimer.Start();
     PMoveTimer.Start();
     GenCarTimer.Start();
     WorkTimer.Start();
     GenPeopleTimer.Start();
     LightsTimer.Start();
     TrafficLight.CreateLight();
     IsReady = true;
 }
コード例 #15
0
ファイル: Form1.cs プロジェクト: robertswita/mined-elearning
 private void button1_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < 25; i++)
     {
         var code = Rnd.Next(9 * RubikCube.N);
         var move = new TMove();
         move.Decode(code);
         Moves.Add(move);
     }
     MoveTimer.Start();
 }
コード例 #16
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (MoveNo < Moves.Count)
     {
         var move = Moves[MoveNo];
         if (FrameNo < FrameCount)
         {
             if (FrameNo == 0)
             {
                 RubikCube.Select(move);
                 RubikCube.Group();
             }
             double angle = (move.Angle + 1) * 90;
             if (angle > 180)
             {
                 angle -= 360;
             }
             var ratio = (double)FrameNo / (FrameCount - 1);
             angle *= ratio;
             RubikCube.Wall.LoadIdentity();
             if (move.Axis == 0)
             {
                 RubikCube.Wall.RotateX(angle);
             }
             else if (move.Axis == 1)
             {
                 RubikCube.Wall.RotateY(angle);
             }
             else
             {
                 RubikCube.Wall.RotateZ(angle);
             }
             FrameNo++;
             tglView1.Invalidate();
         }
         else
         {
             FrameNo = 0;
             MoveNo++;
             RubikCube.Ungroup();
             RubikCube.MakeMove(move);
         }
     }
     else
     {
         MoveTimer.Stop();
         Moves.Clear();
         MoveNo = 0;
         if (HighScore > 0)
         {
             Solve();
         }
     }
 }
コード例 #17
0
 public Bear(int cnt)
 {
     InitializeComponent();
     LoadImage();
     MoveTimer.Interval = 500;
     MoveTimer.Start();
     this.AllowDrop  = true;
     this.DragEnter += new DragEventHandler(Form1_DragEnter);
     this.DragDrop  += new DragEventHandler(Form1_DragDrop);
     name.Text       = (++cnt).ToString();
 }
コード例 #18
0
 public override void DoSomethingSpecial(Mobile from)
 {
     foreach (Item item in GetItemsInRange(8))
     {
         if (item.ItemID == 0x3660 && item.Hue == 1000) //Dark Globe of Sosaria
         {
             Timer m_timerA = new MoveTimer(item, 1);
             m_timerA.Start();
         }
     }
 }
コード例 #19
0
 public static void Start()
 {
     MoveTimer.Start();
     GenCarTimer.Start();
     WorkTimer.Start();
     LightsTimer.Start();
     CurrentRoad        = new Road(1, 1, 1, 1);
     CurrentRoadTransit = new RoadTransit(false, false, false, false, 1, 1, 1, 1);
     TrafficLight.CreateLight();
     IsReady = true;
 }
コード例 #20
0
ファイル: MainGameForm.cs プロジェクト: tay1392/Backgammon
 public void WaitingForMove()
 {
     if (Game.CurrentPerson.IsAI)
     {
         MoveTimer.Start();
     }
     else
     {
         graphic.Wait4Move();
     }
 }
コード例 #21
0
ファイル: Switches.cs プロジェクト: greeduomacro/last-wish
		public override void DoSomethingSpecial( Mobile from )
		{
			foreach ( Item item in GetItemsInRange( 8 ) )
			{
				if ( item.ItemID == 0x3660 && item.Hue == 1000 ) //Dark Globe of Sosaria
				{
					Timer m_timerA = new MoveTimer( item, 1 ); 
					m_timerA.Start();
				}
			}
		}
コード例 #22
0
 private void Igra_Load(object sender, EventArgs e)
 {
     SetStyle(ControlStyles.ResizeRedraw, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     vreme.Start();
     SpawnTimer.Start();
     MoveTimer.Start();
     ReduceSpeed.Start();
 }
コード例 #23
0
ファイル: Platform Run.cs プロジェクト: PeckuBre/Platform-Run
 public Form1()
 {
     InitializeComponent();
     DoubleBuffered = true;
     paused         = false;
     actions        = new Queue <Actions>();
     WindowState    = FormWindowState.Maximized;
     KeyPreview     = true;
     doc            = new PlatformRunDoc(Width, Height - 200 - 2 * Platform.height);
     MoveTimer.Start();
 }
コード例 #24
0
 public override void SetNewStageParameters()
 {
     MoveToStartPosition();
     Direction = Direction.Down;
     Lives     = 0;
     Stars     = GameRandom.RandNumber(0, 3);
     Immortal  = false;
     Amphibian = false;
     Gun       = false;
     MoveTimer.Stop();
     RespawnTimer.Start();
 }
コード例 #25
0
        public override Response Defend(int time)
        {
            if (time < 1)
            {
                return(Response.WrongData);
            }

            DefenceStartTime = DateTime.UtcNow;
            MoveTimer.Sleep(time);

            return(Response.Success);
        }
コード例 #26
0
ファイル: Platform Run.cs プロジェクト: PeckuBre/Platform-Run
 private void pauseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (paused)
     {
         MoveTimer.Stop();
     }
     else
     {
         MoveTimer.Start();
     }
     paused = !paused;
 }
コード例 #27
0
        }   // Oyun sırasını hareketlendiren timer

        private void MoveA_Tick(object sender, EventArgs e)
        {
            if (turnMoveTEMP == turnMoveMAX)
            {
                playerTurn++;
                MoveTimer.Stop();
            }
            else
            {
                moveTo();
                turnMoveTEMP++;
            }
        }  // Oyuncu hareketlerini sürdüren timer
コード例 #28
0
ファイル: GameBoard.cs プロジェクト: dylant44/Final
        public GameBoard(int speed)                                                 // sets timer intervals and starts key click event handler
        {
            InitializeComponent();
            KeyDown += new KeyEventHandler(GameBoard_KeyDown);

            Speed = speed;

            MoveTimer.Interval = 100 / speed;
            MoveTimer.Start();

            CollisionTimer.Interval = 100 / speed;
            CollisionTimer.Start();
        }
コード例 #29
0
        private void StartTravel(PlayerMobile pm, BBTravel BBT)
        {
            if (New_Map == null || New_Map == Map.Internal)
            {
                return;
            }

            if (pm != null && BBT != null)
            {
                Move_Timer = new MoveTimer(pm, BBT);
                Move_Timer.Start();
            }
        }
コード例 #30
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Timer = new MoveTimer(this);

            if (version > 0)
            {
                m_MilkedOn = reader.ReadDateTime();
                m_Cider    = reader.ReadInt();
            }
        }
コード例 #31
0
        private void buttonPlay_Click(object sender, EventArgs e)
        {
            PlayerAnimate.Start();
            virusStartScreen.Visible = false;
            labelTitle.Visible       = false;
            buttonPlay.Visible       = false;
            this.Height = 460;
            this.Width  = 760;
            int rand1 = rand.Next(30, 730);
            int rand2 = rand.Next(30, 430);

            Player.Location = new Point(rand1, rand2);
            MoveTimer.Start();
        }