// Use this for initialization void Start() { Rate = 1; Count = 0; SceneObj = GameObject.FindObjectOfType <SceneController>(); FadeObj = SceneObj.transform.Find("FadeCanvas").GetComponent <FadeController>(); Cannons = GameObject.Find("ColdSleepCannons(Clone)"); Cursors = GameObject.Find("Cursors(Clone)"); FadeFlg = false; g_UI = GameObject.Find("GameUI"); _slider_Background = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(0).gameObject; _slider_Fillarea = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(1).gameObject; _sliderText1 = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(2).gameObject; _sliderText2 = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(3).gameObject; _slider_Handle = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(4).gameObject; S_timer = GameObject.FindObjectOfType <StartTimer>(); VanishGroundFlg = false; PerformanceGround = GameObject.Find("PerformanceGround"); ParentGround1 = GameObject.Find("PerfomanceObj01"); ParentGround2 = GameObject.Find("PerfomanceObj02"); ParentGround3 = GameObject.Find("PerfomanceObj03"); VanishGround = PerformanceGround.GetComponent <VanishWall>(); VanishParent1 = ParentGround1.GetComponent <VanishWall>(); VanishParent2 = ParentGround2.GetComponent <VanishWall>(); VanishParent3 = ParentGround3.GetComponent <VanishWall>(); LookTarget = GameObject.Find("LookTarget"); }
private void Start() { PracticalPlayers = DebugModeGame.GetProperty().m_debugMode ? DebugModeGame.GetProperty().m_debugPlayerNum : MaxPlayers; GameObject ParentCursor = GameObject.Find("Cursors(Clone)"); for (int i = 0; i < MaxPlayers; i++) { if (i < PracticalPlayers) { targetCursor[i] = ParentCursor.transform.GetChild(i).GetComponent <Cursor>(); } else { ParentCursor.transform.GetChild(i).gameObject.SetActive(false); } } gameController = GameObject.FindObjectOfType <GameController>(); if (gameController == null) { Debug.LogError("Gamecontrollerがシーンにありません"); } myInputManager = GameObject.FindObjectOfType <MyInputManager>(); if (myInputManager == null) { Debug.LogError("MyInputManagerがシーンにありません"); } g_UI = GameObject.Find("GameUI"); _slider_Background = g_UI.transform.GetChild(0).transform.GetChild(3).transform.GetChild(0).gameObject; _slider_Fillarea = g_UI.transform.GetChild(0).transform.GetChild(3).transform.GetChild(1).gameObject; timer = GameObject.FindObjectOfType <StartTimer>(); }
// Use this for initialization void Start() { Rate = 1; Count = 0; SceneObj = GameObject.FindObjectOfType <SceneController>(); FadeObj = SceneObj.transform.Find("FadeCanvas").GetComponent <FadeController>(); Cannons = GameObject.Find("HoruHoruCannons(Clone)"); Cursors = GameObject.Find("Cursors(Clone)"); FadeFlg = false; g_UI = GameObject.Find("GameUI"); _slider_Background = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(0).gameObject; _slider_Fillarea = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(1).gameObject; _sliderText1 = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(2).gameObject; _sliderText2 = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(3).gameObject; _slider_Handle = g_UI.transform.GetChild(0).transform.GetChild(4).transform.GetChild(4).gameObject; S_timer = GameObject.FindObjectOfType <StartTimer>(); Fireballflg = false; //振動 if (setShakeTime <= 0.0f) { setShakeTime = 0.7f; } lifeTime = 0.0f; }
void RestartButton_Click(object sender, EventArgs e) { matched = 0; timePassed = 0; NameBox.Text = ""; StartTimer.Start(); NameBox.Hide(); AskName.Hide(); DisplayVictory.Hide(); SubmitButton.Hide(); Deck deck = new Deck(); PictureBox[] boxes = new PictureBox[] { pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5, pictureBox6, pictureBox7, pictureBox8, pictureBox9, pictureBox10, pictureBox11, pictureBox12, pictureBox13, pictureBox14, pictureBox15, pictureBox16 }; totalCards = boxes.Count(); foreach (PictureBox pictureBox in boxes) { Card card = deck.Deal(); pictureBox.Image = card.CurrentImage; pictureBox.Tag = card; pictureBox.Show(); } }
/// <summary> /// Initializes a new instance of the <see cref="ExecutionTime"/> class. /// </summary> /// <param name="action">The action of which the execution time must be asserted.</param> /// <param name="actionDescription">The description of the action to be asserted.</param> /// <remarks> /// This constructor is almost exact copy of the one accepting <see cref="Action"/>. /// The original constructor shall stay in place in order to keep backward-compatibility /// and to avoid unnecessary wrapping action in <see cref="Task"/>. /// </remarks> /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception> protected ExecutionTime(Func <Task> action, string actionDescription, StartTimer createTimer) { Guard.ThrowIfArgumentIsNull(action, nameof(action)); ActionDescription = actionDescription; IsRunning = true; Task = Task.Run(async() => { // move stopwatch as close to action start as possible // so that we have to get correct time readings try { using (timer = createTimer()) { await action(); } } catch (Exception exception) { Exception = exception; } finally { IsRunning = false; } }); }
public void ChangeCamera() { MainCamera.SetActive(!MainCamera.activeSelf); SubCamera.SetActive(!SubCamera.activeSelf); this.gameObject.SetActive(false); Cannons.transform.Find("Cannon6Arc").gameObject.SetActive(true); Cannons.transform.Find("CannonMng").gameObject.SetActive(true); OnCursors(); _slider_Background.gameObject.SetActive(true); _slider_Fillarea.gameObject.SetActive(true); _sliderText1.gameObject.SetActive(true); _sliderText2.gameObject.SetActive(true); _slider_Handle.gameObject.SetActive(true); FadeController.Begin(FadeObj.gameObject, true, Rate); if (S_timer == null) { S_timer = GameObject.FindObjectOfType <StartTimer>(); S_timer.On_TimeStartFlg(); } else { S_timer.On_TimeStartFlg(); } FadeObj.m_onFinished -= ChangeCamera; }
private void StartTimer_Tick(object sender, EventArgs e) { ProgTimer.Stop(); StartTimer.Stop(); this.Text = mTitle + ": Typing now..."; // Load text into memory if (this.mIsClipboardAction) { mTextToSend = Clipboard.GetText(TextDataFormat.UnicodeText); } else { mTextToSend = TextBuffer.Text; } // remove unwanted chars and set start typing pos mTextToSend = mTextToSend.Replace("\r", ""); mTextToSendIdx = 0; // Set progress bar output ProgBar.Value = 0; ProgBar.Minimum = 0; ProgBar.Maximum = mTextToSend.Length; // Start send of the text mStartTextSend = true; TxtTimer.Interval = (int)DelayCharsSendNum.Value; TxtTimer.Start(); }
private void StartTimerAction(DateTime datetime) { _isStopTimer = false; if (StartTimer != null) { StartTimer.Invoke(datetime); } }
private void GameEnd() { StartTimer.Stop(); NameBox.Show(); AskName.Show(); DisplayVictory.Show(); SubmitButton.Show(); }
// Use this for initialization void Start() { player = GameObject.Find("player"); GameObject timerObj = GameObject.Find("Start Timer"); startTimer = timerObj.GetComponent <StartTimer>(); }
private void StartTimer_Tick(object sender, EventArgs e) { StartTimer.Dispose(); StartForm startForm = new Assignment4.StartForm(); startForm.Show(); this.Hide(); }
private void StartTimer_Tick(object sender, EventArgs e) { FeaturesProgressBar.Value = 0; FeaturesProgressBar.Maximum = Commands.Count; StartTimer.Stop(); Commands.Process(); }
private void StartTimer_Tick(object sender, EventArgs e) { FeaturesProgressBar.Value = 0; FeaturesProgressBar.Maximum = Commands.Count; StartTimer.Stop(); Task.Run(async() => await Commands.ProcessAsync()); }
//constructors public StartProtocolGenerator(DistanceGroupAmount type, StartTimer timer) { this.grAmount = type; this.LHeaders = Globals.Options.startProtocolHeaders1; this.timer = timer; string typeRepresent = EnumCasters.GroupAmountStringRepresent(GrAmount); SheetName = Globals.SheetNames.StartProtocol + " (" + typeRepresent + ")"; }
public static void Initialize() { CursorVisible = false; StartTimer.Run(5, () => { InputManager.KeyPressed += InputManager.InputManagerOnKeyPressed; InputManager.Start(); Render(); }); }
public void TestStartTimer() { var trigger = new StartTimer("90"); Assert.AreEqual(90, trigger.StartingTime); var player = new Player(); GameTrigger.OnGameStarting(); Assert.AreEqual(trigger.StartingTime, player.Time); GameTrigger.OnUpdateEverySecond(); }
private void InitializeControls() { Commands.NotifyFeatureCommandCollectionExecuting += NotifyFeatureCommandCollectionExecuting; Commands.NotifyFeatureCommandCollectionExecuted += NotifyFeatureCommandCollectionExecuted; Commands.NotifyFeatureCommandsCollectionFinish += NotifyFeatureCommandsCollectionFinish; Commands.NotifyFeatureCommandsCollectionStart += NotifyFeatureCommandsCollectionStart; FeaturesProgressBar.Value = 0; FeaturesProgressBar.Maximum = Commands.Count; StartTimer.Start(); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SupportActionBar.Elevation = 0; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SetContentView(Resource.Layout.exercise_question); WebView = FindViewById <WebView>(Resource.Id.webView1); group = FindViewById <RadioGroup>(Resource.Id.radio_group); NextBtn = FindViewById <ImageButton>(Resource.Id.btn_floating_action); pb = FindViewById <ProgressBar>(Resource.Id.pb); TimerText = FindViewById <TextView>(Resource.Id.text_timer); TextQuestionNumber = FindViewById <TextView>(Resource.Id.question_number); tv = FindViewById <TextView>(Resource.Id.tv); // TextQuestion = FindViewById<TextView>(Resource.Id.question); ExaminationID = Intent.GetIntExtra(nameof(ExaminationID), 0); CurExamination = await Data.Examination.DB.RowsAsync.FirstOrDefaultAsync(c => c.ID == ExaminationID); await CurExamination.LoadCourse(); await CurExamination.LoadModule(); //await CurExamination.LoadQuestions(); var guid = Guid.NewGuid(); UserExamination = new UserExamination { CreationDate = DateTime.Now, UserID = SessionManager.User.ID, StartTime = DateTime.Now, CourseID = CurExamination.CourseID.Value, ModuleID = CurExamination.ModuleID.Value }; UserExamination.ID = guid; UserExamination.ExaminationID = CurExamination.ID; Questions = Question.DB.Rows.Where(c => c.ExaminationID == ExaminationID).ToList().Shuffled().ToList();// (List<Question>)CurExamination.Questions.Shuffled(); Count = Questions.Count; pb.Max = Count; // uptask = new UpdatePB(this, pb, tv, Count); // uptask.Execute(100); if (Questions.Count > 0) { Question = Questions.FirstOrDefault(); SessionManager.CanViewResults = false; } UserExamination.DB.Insert(UserExamination); var answers = Answer.DB.Rows.Where(c => c.QuestionID == Question.ID).ToList().Shuffled().ToList(); StartExercise(Question, answers, group); StartTimer = new StartTimer(this, TimerText) { StartDate = DateTime.Now, }; StartTimer.Start(); tv.Text = $"Question {Counter} of {Count}"; TextQuestionNumber.Text = $"Question number {Counter}"; pb.Progress = Counter; // SetProgress(Counter, true); }
private void startAutoTypeAction(Boolean isClipboardAction) { this.mIsClipboardAction = isClipboardAction; this.Text = mTitle + ": Delaying " + ((int)DelayStartSecsNum.Value).ToString() + " seconds before typing.."; mStartTextSend = false; StartTimer.Interval = ((int)DelayStartSecsNum.Value * 1000); ProgBar.Maximum = StartTimer.Interval / ProgTimer.Interval; ProgBar.Minimum = 0; ProgBar.Value = ProgBar.Maximum; ProgBar.Refresh(); StartTimer.Start(); ProgTimer.Start(); }
public BoilTimerViewModel(IScreen hostScreen) { HostScreen = hostScreen; StartTimer = ReactiveCommand.Create(); StartTimer.Subscribe(); PauseTimer = ReactiveCommand.Create(); PauseTimer.Subscribe(); ResetTimer = ReactiveCommand.Create(); ResetTimer.Subscribe(); }
// Use this for initialization void Start() { Rate = 1; Count = 0; SceneObj = GameObject.FindObjectOfType <SceneController>(); FadeObj = SceneObj.transform.Find("FadeCanvas").GetComponent <FadeController>(); Cannons = GameObject.Find("ColdSleepCannons(Clone)"); Cursors = GameObject.Find("Cursors(Clone)"); FadeFlg = false; g_UI = GameObject.Find("GameUI"); _slider_Background = g_UI.transform.GetChild(0).transform.GetChild(3).transform.GetChild(0).gameObject; _slider_Fillarea = g_UI.transform.GetChild(0).transform.GetChild(3).transform.GetChild(1).gameObject; S_timer = GameObject.FindObjectOfType <StartTimer>(); }
// Method is called each time the StartTimer timer ticks private void StartTimerTick(object sender, EventArgs e) { // Increase the Opacity of the form to make the form more visible Opacity += 0.05; // If the form is at 100% opacity (or fully visible) if (Math.Abs(Opacity - 100) < 0.05) { // Stop the timer StartTimer.Enabled = false; // Dispose of the timer to free resources StartTimer.Dispose(); } }
private void StartTimer_Tick(object sender, EventArgs e) { timer1.Enabled = true; timer1.Start(); gif = Properties.Resources.bck; fd = new System.Drawing.Imaging.FrameDimension(gif.FrameDimensionsList[0]); count = gif.GetFrameCount(fd); System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 200; timer.Tick += Timer_Tick; timer.Start(); StartTimer.Stop(); StartTimer.Enabled = false; }
void Start() { GameObject timerObj = GameObject.Find("Start Timer"); startTimer = timerObj.GetComponent <StartTimer>(); sprite = GetComponent <SpriteRenderer>(); if (Random.value >= 0.5) { goingUp = true; } else { goingUp = false; } }
void Start() { //get required game objects controller = GetComponent <Controller2D> (); sound = GetComponent <AudioSource>(); GameObject globalObj = GameObject.Find("Globals"); globals = globalObj.GetComponent <GlobalVariables>(); goals = globalObj.GetComponent <GoalsScript>(); GameObject timerObj = GameObject.Find("Start Timer"); startTimer = timerObj.GetComponent <StartTimer>(); //set size of player transform.localScale = new Vector3(1, 1, 1); }
private void Form1_Load(object sender, EventArgs e) { dir = new List <Tuple <int, int> >(); dir.Add(new Tuple <int, int>(-1, 0)); dir.Add(new Tuple <int, int>(-1, -1)); dir.Add(new Tuple <int, int>(0, -1)); dir.Add(new Tuple <int, int>(1, -1)); dir.Add(new Tuple <int, int>(1, 0)); dir.Add(new Tuple <int, int>(1, 1)); dir.Add(new Tuple <int, int>(0, 1)); dir.Add(new Tuple <int, int>(-1, 1)); direction = Direction.RightTop; this.Location = new Point(519, 315); this.TopMost = true; StartTimer.Enabled = true; StartTimer.Start(); }
public GameForm() { InitializeComponent(); Deck deck = new Deck(); boxes = new PictureBox[] { pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5, pictureBox6, pictureBox7, pictureBox8, pictureBox9, pictureBox10, pictureBox11, pictureBox12, pictureBox13, pictureBox14, pictureBox15, pictureBox16 }; StartTimer.Start(); totalCards = boxes.Count(); NameBox.Hide(); AskName.Hide(); DisplayVictory.Hide(); SubmitButton.Hide(); foreach (PictureBox pictureBox in boxes) { Card card = deck.Deal(); pictureBox.Image = card.CurrentImage; pictureBox.Tag = card; } }
public MashTimerViewModel(IScreen hostScreen, BrewData data) { HostScreen = hostScreen ?? Locator.Current.GetService <IScreen> (); CurrentTimeRemaining = (int)data.MashTime.TotalSeconds; var canStartOrReset = this.WhenAnyValue(x => x.IsTimerRunning).Where(x => !x); StartTimer = ReactiveCommand.Create(canStartOrReset); var start = StartTimer.Select(x => true); PauseTimer = ReactiveCommand.Create(this.WhenAnyValue(x => x.IsTimerRunning).Where(x => x)); var pause = PauseTimer.Select(x => false); Observable.Merge(start, pause) .StartWith(false) .ToProperty(this, vm => vm.IsTimerRunning, out _IsTimerRunning); ResetTimer = ReactiveCommand.Create(canStartOrReset); ResetTimer.Subscribe(_ => { CurrentTimeRemaining = (int)data.MashTime.TotalSeconds; }); this.WhenAnyValue(x => x.IsTimerRunning) .Where(x => x == true) .Subscribe(_ => Device.StartTimer(TimeSpan.FromSeconds(1), () => { if (CurrentTimeRemaining > 0) { CurrentTimeRemaining -= 1; } return(IsTimerRunning); })); this.WhenAnyValue(x => x.CurrentTimeRemaining) .Select(x => TimeSpan.FromSeconds(x).ToString()) .ToProperty(this, vm => vm.ClockText, out _ClockText); }
//Braucht die position des Trägers! public override void Update(GameTime gameTime) { float fps = 1f / Speed; float mspf = 1000f / Speed; switch (State) { case AnimationState.Play: { float elapsed = gameTime.ElapsedGameTime.Milliseconds; totalElapsed += elapsed; if (totalElapsed > mspf) { totalElapsed -= mspf; switchToNextFrame(); } break; } case AnimationState.CountDown: { StartTimer.Update(gameTime); break; } case AnimationState.Stop: { break; } case AnimationState.Pause: { break; } } activeTexture = pictures[activeFrameNumber]; }
void When(StartTimer e) => ThenSchedule.At(new TimerDue(), Clock.Now.AddSeconds(1));
public override void StartGame(Mobile gm) { base.StartGame(gm); m_GameItems = new List<Item>(); Rectangle2D playerarea = new Rectangle2D(GameAreaStartPoint.X, GameAreaStartPoint.Y, GameAreaEndPoint.X - GameAreaStartPoint.X + 1, GameAreaEndPoint.Y - GameAreaStartPoint.Y + 1); IPooledEnumerable players = Map.GetMobilesInBounds(playerarea); foreach (Mobile player in players) { if (player.AccessLevel == AccessLevel.Player) AddPlayer(player); } #region Create stones for gamearea int startx = m_GameArea.Start.X; int starty = m_GameArea.Start.Y; int endx = m_GameArea.End.X; int endy = m_GameArea.End.Y; BombermanStone stone; for (int x = 0; x <= endx - startx; ++x) { for (int y = 0; y <= endy - starty; ++y) { if(x != 0 && x != endx - startx && y != 0 && y != endy - starty) { if (x % 2 == 1 && y % 2 == 1) { stone = new BombermanStone(false, this); } else { stone = new BombermanStone(true, this); } stone.MoveToWorld(new Point3D(startx + x, starty + y, Map.Tiles.GetLandTile(startx + x, starty + y).Z), Map); m_GameItems.Add(stone); } else if ((x == 0 || x == endx - startx) && y > 1 && y < endy - starty - 1) { stone = new BombermanStone(true, this); stone.MoveToWorld(new Point3D(startx + x, starty + y, Map.Tiles.GetLandTile(startx + x, starty + y).Z), Map); m_GameItems.Add(stone); } else if ((y == 0 || y == endy - starty) && x > 1 && x < endx - startx - 1) { stone = new BombermanStone(true, this); stone.MoveToWorld(new Point3D(startx + x, starty + y, Map.Tiles.GetLandTile(startx + x, starty + y).Z), Map); m_GameItems.Add(stone); } } } #endregion #region Handle players: location, items, etc Point2D upleft = m_GameArea.Start; Point2D downright = m_GameArea.End; Point2D upright = new Point2D(downright.X, upleft.Y); Point2D downleft = new Point2D(upleft.X, downright.Y); byte index = 0; List<Mobile> toRemove = new List<Mobile>(); foreach (Mobile m in Players) { switch (index++) { case 0: m.Location = new Point3D(upleft, Map.Tiles.GetLandTile(upleft.X, upleft.Y).Z); break; case 1: m.Location = new Point3D(downright, Map.Tiles.GetLandTile(upright.X, upright.Y).Z); break; case 2: m.Location = new Point3D(downleft, Map.Tiles.GetLandTile(downleft.X, downleft.Y).Z); break; case 3: m.Location = new Point3D(upright, Map.Tiles.GetLandTile(downright.X, downright.Y).Z); break; default: toRemove.Add(m); PublicOverheadMessage(MessageType.Regular, 906, true, "There are more than 4 mobiles in the game area."); break; } } foreach (Mobile mob in toRemove) { RemovePlayer(mob); } #endregion StartTimer timer = new StartTimer(this); timer.Start(); gm.SendMessage("The game has been started."); }