private void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (resourceRealizationSize != sender.Size) { needsResourceRecreation = true; } }
public void Update(CanvasAnimatedUpdateEventArgs args) { foreach (PuzzleAnimatedWord word in Words) { word.Update(args); } }
private void RenderPanelUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { lock (Coordinator) { if (RequestedCoreOperationTCS != null) { var requestedOperation = (Func <bool>)RequestedCoreOperationTCS.Task.AsyncState; var result = requestedOperation.Invoke(); RequestedCoreOperationTCS.SetResult(result); RequestedCoreOperationTCS = null; } if (CoreIsExecuting && !Coordinator.AudioPlayerRequestsFrameDelay) { try { Coordinator.Core?.RunFrame(); } catch (Exception e) { GameID = null; CoreIsExecuting = false; Coordinator.AudioPlayer?.Stop(); CoreRunExceptionOccurred(Coordinator.Core, e); } } } }
public override void Update(CanvasAnimatedUpdateEventArgs args) { foreach(win2d_Control control in Controls) { control.Update(args); } }
public static void Update(CanvasAnimatedUpdateEventArgs args) { foreach (SolveIcon icon in _icons) { icon.Update(args); } }
void Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { foreach (var ball in bouncingBalls) { ball.Update(sender.Size); } }
private void OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { float height = (float)sender.Size.Height; float totalHeight = characters.Length * lineHeight + height; if (inManipulation) { if (gestureRecognizer != null) { gestureRecognizer.ProcessInertia(); } } else { velocity = velocity * 0.90f + targetVelocity * 0.10f; offset = offset + velocity; } offset = offset % totalHeight; while (offset < 0) { offset += totalHeight; } float top = height - offset; firstLine = Math.Max(0, (int)(-top / lineHeight)); lastLine = Math.Min(characters.Length, (int)((height + lineHeight - top) / lineHeight)); }
private void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (gameOver) { UpdateWeirdBackgroundScrolling(); return; // No animating } UpdateBackgroundScrolling(); if (rowClearingAnimation.IsAnimating()) { rowClearingAnimation.Update(); if (!rowClearingAnimation.IsAnimating()) { grid.PurgeClearedRows(); } } else { UpdateTimedDrop(); UpdateForcedDrop(); if (!rowClearingAnimation.IsAnimating()) { UpdateCamera(); } } }
private void canvasWin2d_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { // Loop over all the particles. for (int i = 0; i < maxParticles; i++) { // Update the horizontal position. particles[i].newLeft += particles[i].hDir; // If outside the bounds, then invert the direction of motion. if (particles[i].newLeft - radius <= 0) { particles[i].hDir = 1; } else if (particles[i].newLeft >= wComponent) { particles[i].hDir = -1; } // Update the vertical position. particles[i].newTop += particles[i].vDir; // If outside the bounds, then invert the direction of motion. if (particles[i].newTop - radius <= 0) { particles[i].vDir = 1; } else if (particles[i].newTop >= hComponent) { particles[i].vDir = -1; } } }
public static void Update(CanvasAnimatedUpdateEventArgs args) { if (!_initialized) { return; } lock (FloatyWordsLock) { if (FloatingWordsQueue.Count > 0 && Statics.r.Next(50) == 0) { FloatyWords.Add(new BackgroundAnimatedString(_device, FloatingWordsQueue.Dequeue())); } for (int i = FloatyWords.Count - 1; i >= 0; i--) { if (FloatyWords[i].IsOutOfBounds) { FloatyWords.RemoveAt(i); } else { FloatyWords[i].Update(args); } } } }
public void Update(CanvasAnimatedUpdateEventArgs args) { switch (_state) { case TIMED_STRING_STATE.FADING_IN: _opacity += _opacitystep; if (_opacity == 255) { _state = TIMED_STRING_STATE.DISPLAYING; } break; case TIMED_STRING_STATE.DISPLAYING: _age += args.Timing.ElapsedTime.TotalMilliseconds; if (_age >= _lifespan) { _state = TIMED_STRING_STATE.FADING_OUT; } break; case TIMED_STRING_STATE.FADING_OUT: _opacity -= 17; if (_opacity == 0) { _state = TIMED_STRING_STATE.DEAD; } break; } }
private void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (!PAUSED) { covidGame.Update(); } }
private void Canvas_OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { foreach (var temp in FireflyParticle) { temp.Time(args.Timing.ElapsedTime); } }
public override void Update(CanvasAnimatedUpdateEventArgs args) { if (HasFocus) { Cursor.Update(args); } }
public virtual void Update(CanvasAnimatedUpdateEventArgs args) { foreach (PuzzleAnimatedLine line in Lines) { line.Update(args); } }
/// <summary> /// Update du SlateView /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void OnSlateViewUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (machine.IsStarted) { var xboxGamepads = xboxGamepadManager.GetGamepads(); // fusion entre les Gamepads XBOX et le keyboard int value1 = 0; int value2 = 0; if (xboxGamepads[0] != null) { value1 = xboxGamepads[0].GetValue(); } if (xboxGamepads[1] != null) { value2 = xboxGamepads[1].GetValue(); } value1 = value1 | value2; value2 = keyboardGamepad.GetValue(); value1 = value1 | value2; machine.GamepadGlobal.SetValue(value1); } }
private void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { num = game.Duration; bombCount = game.Definition.numOfBomb; flagCount = game.GetFlagCount(); score = game.numberOfRevealedSpots; }
private void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { //Update game objects gameObjects.Update(MILLISECONDS_PER_FRAME); //Check for collision events collisions.CollisionTest(); //Count down spawn timer spawnTime -= MILLISECONDS_PER_FRAME; //If timer ended if (spawnTime <= 0.0) { //Spawn an enemy SpawnEnemy(); //Reset the timer ResetEnemySpawnTimer(); } //If all players dead if (players.IsEmpty()) { //Jump to main menu TODO (crashing due to a thread error) //this.Frame.Navigate(typeof(MainMenuPage)); } }
private void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { // Swap the current and next surfaces. var tmp = currentSurface; currentSurface = nextSurface; nextSurface = tmp; }
private void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { //Check for collision events collisions.CollisionTest(); //Update game objects gameObjects.Update(MILLISECONDS_PER_FRAME); }
void Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { foreach (var ball in bouncingBalls) { var vv = attractor.Attract(ball); ball.Force(vv); ball.Update(sender.Size); } }
public void Update(CanvasAnimatedUpdateEventArgs args) { foreach (PuzzleAnimatedCharacter c in _characters) { c.Update(args); } loopCount++; }
public void Update(CanvasAnimatedUpdateEventArgs args) { _offsetY = (int)(7 * Math.Sin(++loopCount * 0.05)); _rotation = (_rotation + 1) % 360; switch (State) { case STATE.GROWING: scalingFactor += 0.1f; if (scalingFactor >= 1.5f) { State = STATE.SHRINKING; } break; case STATE.SHRINKING: scalingFactor -= 0.1f; if (scalingFactor <= 1.0f) { scalingFactor = 1.0f; State = STATE.NORMAL; } break; case STATE.FADING_IN: byte step = 2; if (255 - opacity <= step) { opacity = 255; State = STATE.NORMAL; } else { opacity += step; } break; case STATE.SOLVE_EXIT_STAGE_LEFT: _solvedPosition.X -= _solvedVelocityX; _solvedPosition.Y += _solvedVelocityY; _solvedVelocityX += 2; if (_solvedPosition.X < -Width) { State = STATE.DONE; } break; case STATE.SOLVE_EXIT_STAGE_RIGHT: _solvedPosition.X += _solvedVelocityX; _solvedPosition.Y += _solvedVelocityY; _solvedVelocityX += 2; if (_solvedPosition.X > 1920) { State = STATE.DONE; } break; } }
private void OnGameCanvasUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { _count = args.Timing.UpdateCount; _elapsed = args.Timing.ElapsedTime.TotalMilliseconds; if (!sender.Paused) { _game?.Update(new TimingInfo(args.Timing.ElapsedTime, args.Timing.TotalTime)); } }
private void OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (pointerPoints.Count > 0) { pointerPoints.Dequeue(); } updatesThisDraw++; }
private void PongCanvas_OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (_pongGame == null) { return; } _pongGame.Update(); }
private async void animatedControl_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { bitmap = await CanvasBitmap.LoadAsync(sender, Items[i]); i++; if (i >= Items.Count) { i = 0; } }
private void CanvasMain_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { Stopwatch s = Stopwatch.StartNew(); Screens.Update(args); s.Stop(); Debugging.LastUpdateMilliseconds = s.ElapsedMilliseconds; Debugging.Update(args); }
private void OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { updatesPerDrawRenderer.Update(); if (step) { sender.Paused = true; step = false; } }
void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (ThumbnailGenerator.IsDrawingThumbnail) { spinTheTeapot = 5.7f; } else if (SpinEnabled) { spinTheTeapot += (float)args.Timing.ElapsedTime.TotalSeconds; } }
void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { // Randomly offset the sketch overlay pattern to create a hand-drawn animation effect. const int jitterRate = 5; const float jitterOffset = 256; if (args.Timing.UpdateCount % jitterRate == 0) { sketchEffect.Properties["JitterX"] = (float)random.NextDouble() * jitterOffset; sketchEffect.Properties["JitterY"] = (float)random.NextDouble() * jitterOffset; } }
private void canvasMain_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { lock(TileLock) { for (int x = 0; x < nTilesX; x++) { for (int y = 0; y < nTilesY; y++) { Tiles[x, y].Update(args); } } } }
void Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { var elapsedTime = (float)args.Timing.ElapsedTime.TotalSeconds; switch (CurrentMode) { case ParticleMode.Explosions: CreateExplosions(elapsedTime); break; case ParticleMode.SmokePlume: CreateSmokePlume(elapsedTime); break; } smokePlume.Update(elapsedTime); smoke.Update(elapsedTime); explosion.Update(elapsedTime); }
private void canvasMain_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { switch(State) { case GAMESTATE.ADDING_ROOMS: if (Rooms.Count < nMaxRooms) { Rooms.Add(Room.CreateRandomRoom()); } else { State = GAMESTATE.SEPARATING_ROOMS; } break; case GAMESTATE.SEPARATING_ROOMS: break; case GAMESTATE.DONE: break; } }
public void Update(CanvasAnimatedUpdateEventArgs args) { switch (State) { case DISPLAYTILESTATE.FADING_IN: Opacity += 5; if (Opacity == 255) { State = DISPLAYTILESTATE.ACTIVE; } CalculateBackgroundColorStep(); break; case DISPLAYTILESTATE.ACTIVE: CurrentActiveDurationInMilliseconds += args.Timing.ElapsedTime.TotalMilliseconds; if (CurrentActiveDurationInMilliseconds > MaxActiveDurationInMilliseconds) { CurrentActiveDurationInMilliseconds = 0; State = DISPLAYTILESTATE.FADING_OUT; } CalculateBackgroundColorStep(); break; case DISPLAYTILESTATE.FADING_OUT: Opacity -= 5; if (Opacity == 0) { RecycleFeedItemData(); State = DISPLAYTILESTATE.INACTIVE; } break; case DISPLAYTILESTATE.INACTIVE: // get new feed item? if (Statics.Random.Next(10) == 0) { SetFeedItem(Statics.CanvasDevice, FeedDataSource.GetNextFeedItem()); TargetBackgroundColor = Statics.RandomColor(); State = DISPLAYTILESTATE.FADING_IN; } break; } }
internal static void Update(CanvasAnimatedUpdateEventArgs args) { PanelLeft.Update(args); PanelCenter.Update(args); PanelRight.Update(args); }
private void CanvasControl_OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { //for each tank, create translation and rotation matrix foreach (var tank in Tanks) { if (tank.selected && this.FireCommand && !tank.firing) { //calc fire direction and rotate, mark the tank as firing tank.firing = true; //tank.direction = Vector2.Normalize(FiringTargetPos - tank.CurrentPosition); tank.FiringTarget = FiringTargetPos; //tank.desiredRot = (float)Math.Atan2(tank.FiringTarget.Y, tank.FiringTarget.X); FireCommand = false; } else if (!tank.firing) { tank.desiredRot = (float)Math.Atan2(tank.direction.Y, tank.direction.X); } //update rotation until done if (Math.Abs(tank.desiredRot - tank.currentRot) > 0.01f) { tank.rotating = true; //var rot = Math.Atan2(Math.Sin(tank.desiredRot - tank.currentRot), Math.Cos(tank.desiredRot - tank.currentRot)); tank.currentRot = tank.currentRot - 0.05f * (tank.currentRot - tank.desiredRot); //tank.currentRot += (float)rot * 0.05f; } else { tank.rotating = false; //update position if not already on target if (Vector2.Distance(tank.CurrentPosition, tank.TargetPosition) > 1) { tank.CurrentPosition = tank.CurrentPosition + tank.direction; } else { tank.CurrentPosition.X = tank.TargetPosition.X; tank.CurrentPosition.Y = tank.TargetPosition.Y; } if (tank.CurrentPosition.X < minSize.X || tank.CurrentPosition.X > maxSize.X) { tank.direction.X *= -1; } if (tank.CurrentPosition.Y < minSize.Y || tank.CurrentPosition.Y > maxSize.Y) { tank.direction.Y *= -1; } } if (tank.firing && !tank.rotating) { tank.firing = false; //create and fire projectile var projectile = new Projectile(); projectile.pos = new Vector2(tank.CurrentPosition.X, tank.CurrentPosition.Y); projectile.Target = new Vector2(tank.FiringTarget.X, tank.FiringTarget.Y); this.Projectiles.Add(projectile); } var translationMatrix = Matrix3x2.CreateTranslation(tank.CurrentPosition); tank.translationEffect.TransformMatrix = translationMatrix; var rotationMatrix = Matrix3x2.CreateRotation(tank.currentRot); tank.rotationEffect.TransformMatrix = rotationMatrix; } List<Projectile> toRemove = new List<Projectile>(); foreach (var projectile in Projectiles) { if (projectile.pos.X > maxSize.X || projectile.pos.X < minSize.X || projectile.pos.Y > maxSize.Y || projectile.pos.Y < minSize.Y) { toRemove.Add(projectile); continue; } if (Vector2.Distance(projectile.pos, projectile.Target) < 1f) { toRemove.Add(projectile); continue; } projectile.pos = projectile.pos + projectile.direction * 3.0f; } foreach (var projectile in toRemove) { Projectiles.Remove(projectile); } }
public void Update(RichListBoxProminent rlb, CanvasAnimatedUpdateEventArgs args) { UpdateDelta += args.Timing.ElapsedTime; if (UpdateDelta.TotalMilliseconds < Statics.MapUpdateThreshold) { return; } //switch (State) //{ // case MAPSTATE.READY_FOR_BATTLE: // // reset update timer // UpdateDelta = TimeSpan.Zero; // // fight a battle // //Region winner = Regions[Statics.Random.Next(Regions.Count)]; // //Region loser = RandomNeighbor(winner.ID); // //winner.Leader.BattleWins++; // //loser.Leader.BattleLosses++; // //string strRandomDefeatString = Statics.DefeatWords.RandomString(); // //loser.OvertakingRegion = winner; // //LastBattle = new BattleEventArgs(winner, strRandomDefeatString, loser); // ////StringManager.Add(LastBattle.ToRichString()); // //if (rlb != null) { rlb.Add(LastBattle.ToRichString()); } // //State = MAPSTATE.TAKEOVER_IN_PROGRESS; // break; // case MAPSTATE.TAKEOVER_IN_PROGRESS: // // reset update timer // UpdateDelta = TimeSpan.Zero; // //MergeRegions(winner.ID, loser.ID); // // update one tile per frame // if (!MiniMerge()) // { // State = MAPSTATE.PAUSE_BETWEEN_BATTLES; // } // break; // case MAPSTATE.PAUSE_BETWEEN_BATTLES: // // don't update timer unless threshold reached // // check for win condition // if (Regions.Count == 1) // { // Leaderboard.DeclareWinner(Regions[0].Leader.ToString()); // State = MAPSTATE.WIN_DRAW_IMAGE; // } // else if (UpdateDelta.TotalMilliseconds > Statics.PauseBetweenBattlesMilliseconds) // { // UpdateDelta = TimeSpan.Zero; // State = MAPSTATE.READY_FOR_BATTLE; // } // break; // case MAPSTATE.WIN_DRAW_IMAGE: // // reset update timer // UpdateDelta = TimeSpan.Zero; // // partial image draw // if (nWinningImageFrame < 100) // { // nWinningImageFrame += 1; // } // else // { // State = MAPSTATE.WIN_DRAW_STRING; // } // break; // case MAPSTATE.WIN_DRAW_STRING: // // partial string draw // if (nWinningStringFrame < strWinnerString.Length * 5) // { // nWinningStringFrame++; // } // else if (UpdateDelta.TotalSeconds >= 5) // { // State = MAPSTATE.FINISHED; // } // break; //} }
public override void Update(CanvasAnimatedUpdateEventArgs args) { }
void ProcessLevel(CanvasAnimatedUpdateEventArgs args) { if (_gameState == GameState.LevelUp) { _currentLevel++; if (_currentLevel > _gameSequence.Length - 1) _currentLevel = _gameSequence.Length - 1; _currentBeatTime = 0; _currentSequence = _gameSequence[_currentLevel]; _currentElapsedTime = TimeSpan.Zero; _gameState = GameState.ThreeTwoOneGo; } if (_gameState != GameState.ThreeTwoOneGo && _gameState2 != GameState.GotPoints) return; if (!_tribal.IsPlaying) { _tribal.Play(); } if (_tapType == SpheroTapType.DoubleTap) { _tapType = SpheroTapType.None; } _previousElapsedTime = _elapsedTime; _elapsedTime = args.Timing.ElapsedTime; _currentElapsedTime += _elapsedTime; _rewardElapsedTime += _elapsedTime; if ((_gameState2 == GameState.GotPoints || _gameState2 == GameState.Failed) && _currentElapsedTime.TotalMilliseconds > 2000) { _gameState2 = GameState.None; _rewardElapsedTime = TimeSpan.Zero; } if (_gameState2 == GameState.CheckMovement && _rewardElapsedTime.TotalMilliseconds > 1000) { int beat = _currentBeatTime - 1; if (beat < 0) beat = 0; if (_currentMovType == _currentSequence.Movements[beat]) { _gameState2 = GameState.GotPoints; _currentIdxReward = RAND.Next(0, _rewardMessage.Length - 1); _points += (_currentIdxReward + 1) * _currentLevel * beat; } else { _currentMovType = SpheroMovementType.None; _gameState2 = GameState.Failed; _numFails++; } } if (_currentBeatTime < _currentSequence.Times) { _posSpheroSeq.X -= 1; // TODO syncronize the movement with the song and active color if (_currentElapsedTime.TotalMilliseconds > _currentSequence.Tempo || _currentElapsedTime.TotalMilliseconds > _currentSequence.Tempo + _currentSequence.TempoColorSwitch) { _currentColor = _currentSequence.Colors[_currentBeatTime]; if (_currentElapsedTime.TotalMilliseconds > _currentSequence.Tempo + _currentSequence.TempoColorSwitch) _currentElapsedTime = TimeSpan.Zero; _robot.SetRGBLED(_currentColor.R, _currentColor.G, _currentColor.B); _prevBeatTime = _currentBeatTime; _currentBeatTime++; _gameState2 = GameState.CheckMovement; if (_currentBeatTime == _currentSequence.Times) _gameState = GameState.LevelUp; } } if (_currentBeatTime >= _currentSequence.Times && _movType == SpheroMovementType.ShakeIt) { _movType = SpheroMovementType.None; _currentMovType = SpheroMovementType.None; _tribal.Stop(); _currentBeatTime = 0; _currentLevel = 0; _currentElapsedTime = TimeSpan.Zero; } if (_numFails > 6) { _gameState = GameState.GameOver; _movType = SpheroMovementType.None; _tribal.Stop(); _currentColor = Colors.Red; _currentBeatTime = 0; _currentBeatTime = 0; _currentLevel = 0; _currentElapsedTime = TimeSpan.Zero; } }
void OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (!spriteBatchSupported) return; UpdateWizardCycle(); // While the pointer is being held we move the wizard if (touched) { UpdateMovement(); } if (RotateAndScale) rotateAndScaleCounter++; UpdateTransform(sender); }
public void Update(CanvasAnimatedUpdateEventArgs args) { }
private void canvasMain_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { Debug.FrameCount++; switch (State) { case GAMESTATE.UI_DISPLAY: ScreenMainGameUI.Update(args); break; } }
public void Update(CanvasAnimatedUpdateEventArgs args) { LastUpdate += args.Timing.ElapsedTime; if (LastUpdate.TotalMilliseconds > UpdateThreshold) { LastUpdate = TimeSpan.Zero; switch (State) { case CURSOR_STATE.ON: State = CURSOR_STATE.OFF; break; case CURSOR_STATE.OFF: State = CURSOR_STATE.ON; break; } } }
void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { // Use the current surface as input. countNeighborsEffect.Source = currentSurface; // Draw it onto the next surface, using an image effect that implements the Game of Life cellular automaton. using (var ds = nextSurface.CreateDrawingSession()) { ds.DrawImage(liveOrDieEffect); } // Swap the current and next surfaces. var tmp = currentSurface; currentSurface = nextSurface; nextSurface = tmp; }
private void Canvas_Update( ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { this.world.Update(args.Timing.ElapsedTime.TotalSeconds); }
internal void Update(CanvasAnimatedUpdateEventArgs args) { float elapsedTime = (float)args.Timing.TotalTime.TotalSeconds; foreach (var particle in particles) { particle.Update(elapsedTime, bounds); } }
private void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (needsToRecreateResources) { RecreateGeometry(sender); needsToRecreateResources = false; } if (CurrentContourTracingAnimation != ContourTracingAnimationOption.None) { float animationDistanceThisFrame = CurrentContourTracingAnimation == ContourTracingAnimationOption.Slow ? 1.0f : 20.0f; currentDistanceOnContourPath = (currentDistanceOnContourPath + animationDistanceThisFrame) % totalDistanceOnContourPath; #if WINDOWS_UAP Vector2 outTangent; #else Microsoft.Graphics.Canvas.Numerics.Vector2 outTangent; #endif pointOnContourPath = combinedGeometry.ComputePointOnPath(currentDistanceOnContourPath, out outTangent); tangentOnContourPath = outTangent; } }
private void CanvasAnimatedControl_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (_gameState == GameState.Connecting) { if (_robot.ConnectionState == ConnectionState.Failed/* || _robot.ConnectionState == ConnectionState.Disconnected*/) { _gameState = GameState.ConnectionFailed; } return; } if (_gameState == GameState.ConnectionFailed) { _robot = null; SetupRobotConnection(); _gameState = GameState.Connecting; return; } ProcessMovementType(); if (_gameState == GameState.Connected) { _gameState = GameState.Ready; } if (_gameState == GameState.Ready || _gameState == GameState.GameOver) { if (_movType == SpheroMovementType.ShakeIt) { _points = 0; _numFails = 0; _currentLevel = 0; _currentBeatTime = 0; _gameState = GameState.ThreeTwoOneGo; _currentSequence = _gameSequence[_currentLevel]; // starting sequence //if (_posSpheroSeq == Vector2.Zero) //{ _posSpheroSeq = new Vector2((float)sender.Size.Width - 300, ((float)sender.Size.Height / 2f) + 20); //} _robot.SetRGBLED(255, 0, 0); } } ProcessLevel(args); }
private void animatedControl_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { game.Update(); }
private void canvasMain_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (map.Finished) { Reset(sender); } else { Statics.FrameCount++; map.Update(rlbProminent, args); } }
void canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { }
private void Canvas_Update(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { if (Canvas == null) return; var size = Canvas.Size.ToVector2(); var elapsedTime = (float)args.Timing.ElapsedTime.TotalSeconds; var u = ThreadPool.RunAsync((a) => { if ((!isRain) && isNight) { var k = size.X * size.Y; if (star.ActiveParticles.Count < 1e-4 * k) { CreateStar(size); } } star.Update(elapsedTime); }); var v = ThreadPool.RunAsync((b) => { if (isThunder || isHaze || isFog || isCloudy) { timeToCreate -= elapsedTime; CreateSmoke(size); if (timeToCreate < 0) { timeToCreate = Tools.RandomBetween(5, 7); if (isThunder) { thunderGen.Generate(size); } } } smoke.Update(elapsedTime, size); thunderGen.Update(elapsedTime, size); }); var w = ThreadPool.RunAsync((c) => { backBlur.update(size); if (isSunny) sun.Update(); }); if (isRain || isThunder) { if (rainLevel != RainLevel.shower) { CreateRain(size); } else { timeToCreateRain -= elapsedTime; if (timeToCreateRain < 0) { if (timeToCreateRain > -Tools.RandomBetween(7, 15)) CreateRain(size); else { timeToCreateRain = Tools.RandomBetween(2, 15); } } } } rain.Update(elapsedTime, size); }
private void OnUpdate(ICanvasAnimatedControl sender, CanvasAnimatedUpdateEventArgs args) { float height = (float)sender.Size.Height; float totalHeight = characters.Length * lineHeight + height; if (inManipulation) { if (gestureRecognizer != null) gestureRecognizer.ProcessInertia(); } else { velocity = velocity * 0.90f + targetVelocity * 0.10f; offset = offset + velocity; } offset = offset % totalHeight; while (offset < 0) offset += totalHeight; float top = height - offset; firstLine = Math.Max(0, (int)(-top / lineHeight)); lastLine = Math.Min(characters.Length, (int)((height + lineHeight - top) / lineHeight)); }
public static void Update(CanvasAnimatedUpdateEventArgs args) { foreach (win2d_Control control in Controls) { control.Update(args); } // START DEBUG Statics.DebugUpdateTimeString = "Update time: " + args.Timing.ElapsedTime.TotalMilliseconds.ToString() + "ms"; Statics.DebugStringsCount = textblock.DebugStringsCount; // END DEBUG }