public override void Update(Delta delta) { base.Update(delta); alpha -= alphaSpeed * delta.Time; if (alpha <= 0.0f) Kill(); }
public static void UpdateCurrent(Delta delta) { if (Current != null) { if (Current.finished) { Current.finishCleanup(); sceneStack.Pop(); if (nextScene != null) { pushNextScene(); Current.update(delta); } } else { if (nextScene != null) pushNextScene(); Current.update(delta); } } else if (nextScene != null) { pushNextScene(); Current.update(delta); } }
public void Update(Delta delta) { time += delta.Time; velocity.Y += gravity * delta.Time; position += velocity * delta.Time; if (rotate) rotation += radialVelocity * delta.Time; }
public override void Update(Delta delta) { base.Update(delta); time += delta.Time; if (time > floatTimeInSeconds) { Tint = Color.Transparent; Kill(); } }
protected override void update(Delta delta) { base.update(delta); if (gameOverAlphaTimer < gameOverAlphaTime) { gameOverAlphaTimer += delta.Time; if (gameOverAlphaTimer > gameOverAlphaTime) gameOverAlphaTimer = gameOverAlphaTime; } else if (Input.AnyActionButton()) Game1.RestartGame(); }
public override void Update(Delta delta) { base.Update(delta); if ((target.BattleEntity.GetCenter() - GetCenter()).Length() > distance / 2.0f) DepthOverride = actor.BattleEntity.Position.Y - 0.1f; else DepthOverride = target.BattleEntity.Position.Y + 5.0f; if (!collided && CollidesWith(target.BattleEntity)) { collisionCallback(this); collided = false; } }
public void Update(Delta delta) { foreach (InputButton button in eventBindings.Keys) { bool thisButtonPressedThisFrame = Input.ButtonPressed(button); bool thisButtonPressedLastFrame = buttonPressedLastFrame[button]; ButtonEventHandler eventHandler = null; if (thisButtonPressedThisFrame) { eventHandler = thisButtonPressedLastFrame ? eventBindings[button].ButtonPress : eventBindings[button].ButtonDown; buttonPressedLastFrame[button] = true; } else { if (thisButtonPressedLastFrame) eventHandler = eventBindings[button].ButtonUp; buttonPressedLastFrame[button] = false; } if (eventHandler != null) eventHandler(); } }
private void updateForStatusAttribute(Delta delta) { if (statusParticleTextureData == null) return; statusParticleTimer += delta.Time; if (statusParticleTimer >= statusParticleTime) { statusParticleTimer = 0.0f; emitStatusParticle(emitStatusParticleCallback); } }
private void updateForAffiliationAttribute(Delta delta) { if (incAffiliationTintAlpha) { affiliationTintAlpha += affiliationTintAlphaSpeed * delta.Time; if (affiliationTintAlpha >= maxAffiliationTintAlpha) { affiliationTintAlpha = maxAffiliationTintAlpha; incAffiliationTintAlpha = false; } } else { affiliationTintAlpha -= affiliationTintAlphaSpeed * delta.Time; if (affiliationTintAlpha <= 0.0f) { affiliationTintAlpha = 0.0f; incAffiliationTintAlpha = true; } } updateAffiliationTint(affiliationTint, affiliationTintAlpha); }
public void Update(Delta delta) { time += delta.Time; while (scriptActionIndex < script.Actions.Count) { ScriptAction action = script.Actions[scriptActionIndex]; if (time < action.Item1) break; else { executeAction(action); ++scriptActionIndex; } } foreach (NestedScriptRunner nestedScriptRunner in nestedScriptRunners) { if (nestedScriptRunner.Time <= 0.0f) nestedScriptRunner.ScriptRunner.Update(delta); else nestedScriptRunner.Time -= delta.Time; } }
public void Update(Delta delta) { if (Target != null) { Position = new Vector2((float)Math.Round(Target.Position.X), (float)Math.Round(Target.Position.Y)); TargetPosition = Position; } Overworld overworld = Scene.Current as Overworld; if (overworld != null) { Rectangle boundingBox = GetBoundingBox(); Vector2 newPosition = Position; if (boundingBox.Left < 0) newPosition.X -= boundingBox.Left; if (boundingBox.Top < 0) newPosition.Y -= boundingBox.Top; if (boundingBox.Right > overworld.Map.Width) newPosition.X -= boundingBox.Right - overworld.Map.Width; if (boundingBox.Bottom > overworld.Map.Height) newPosition.Y -= boundingBox.Bottom - overworld.Map.Height; Position = newPosition; TargetPosition = Position; } Position = updateVectorToTarget(Position, TargetPosition, delta); Scale = updateVectorToTarget(Scale, TargetScale, delta); updateScreenShake(delta); }
public virtual void Update(Delta delta) { Velocity += Acceleration * delta.Time; Position += Velocity * delta.Time; Rotation += AngularVelocity * delta.Time; if (Skeleton != null) updateSkeleton(delta); else if (Sprite != null) Sprite.Update(delta); if (UpdateExtensions.Count > 0) { foreach (UpdateExtension updateExtension in UpdateExtensions) { if (updateExtension.Active) updateExtension.Action(updateExtension, delta); } UpdateExtensions.RemoveAll(ue => !ue.Active); } }
protected override void update(Delta delta) { if (!CurrentBattleState.KeepPartyMembersStatic) delta.scaleDelta(MathHelper.Lerp(1.0f, 4.0f, Input.LeftTriggerAmount())); if (stateChanged) { stateChanged = false; CurrentBattleState.Start(); Logger.Log(CurrentBattleState.GetType().Name + " battle state started"); } CurrentBattleState.Update(delta); if (CurrentBattleState.KeepPartyMembersStatic) RepositionPartyMembers(); base.update(delta); foreach (PartyMember partyMember in PlayerParty) partyMember.Update(delta); foreach (PartyMember partyMember in EnemyParty) partyMember.Update(delta); if (CurrentBattleState.BattleStateRenderer != null) CurrentBattleState.BattleStateRenderer.Update(delta); if (cameraUpdateDelay > 0.0f) { cameraUpdateDelay -= delta.Time; Camera.Update(delta); } else updateCamera(() => Camera.Update(delta)); }
public static void Update(Delta delta) { Update(hoursPerSecond * delta.Time); }
protected override void update(Delta delta) { base.update(delta); inputButtonListener.Update(delta); }
private Vector2 updateVectorToTarget(Vector2 vector, Vector2 target, Delta delta) { if (vector == target) return vector; float newX = moveFloatTowardsValue(vector.X, target.X, delta); float newY = moveFloatTowardsValue(vector.Y, target.Y, delta); return new Vector2(newX, newY); }
protected override void Update(GameTime gameTime) { if (skipNextUpdate) { skipNextUpdate = false; return; } Delta delta = new Delta((float)gameTime.ElapsedGameTime.TotalSeconds); Input.UpdateInputState(); Scene.UpdateCurrent(delta); base.Update(gameTime); }
public override void Update(Delta delta) { base.Update(delta); foreach (Particle particle in particles) { if (particle.Alive) particle.Update(delta); } }
public virtual void EndTurnUpdate(PartyMember partyMember, Delta delta) { }
public virtual void BeforeActUpdate(ThinkAction thinkAction, Delta delta) { }
public virtual void Update(Delta delta) { updateForStatusAttribute(delta); updateForAffiliationAttribute(delta); }
public virtual void Update(Delta delta) { overworld.SetEntityAnimationForVelocity(party.PrimaryPartyMember.OverworldEntity); }
public override void Update(Delta delta) { if (SkeletonRegionAttachment == null || SkeletonBone == null || SkeletonSlot == null) return; base.Update(delta); }
private void updateSkeleton(Delta delta) { Skeleton.RootBone.X = Position.X; Skeleton.RootBone.Y = Position.Y; Skeleton.RootBone.ScaleX = Scale.X; Skeleton.RootBone.ScaleY = Scale.Y; Skeleton.RootBone.Rotation = Rotation; if (!PauseAnimation) AnimationState.Update(delta.Time); AnimationState.Apply(Skeleton); Skeleton.UpdateWorldTransform(); }
private void updateScreenShake(Delta delta) { if (shakeTarget == Vector2.Zero) return; shakeTimer += delta.Time; if (shakeTimer > shakeTime) Shake(shakeTarget, shakeTime); else shakePosition = Vector2.Lerp(shakePosition, shakeTarget, shakeTimer / shakeTime); Position += shakePosition; }
public void UpdateInvincibility(Delta delta) { if (PlayerIsInvincible) playerInvincibilityTimer -= delta.Time; }
public abstract void Update(Delta delta);
protected override void update(Delta delta) { if (stateChanged) { stateChanged = false; CurrentOverworldState.Start(); Logger.Log(CurrentOverworldState.GetType().Name + " overworld state started"); } CurrentOverworldState.Update(delta); base.update(delta); if (CurrentOverworldState.OverworldStateRenderer != null) CurrentOverworldState.OverworldStateRenderer.Update(delta); camera.Update(delta); //Clock.Update(delta); }
protected virtual void update(Delta delta) { if (entitiesToAdd.Count > 0) { Entities.AddRange(entitiesToAdd); entitiesToAdd.Clear(); } foreach (Entity entity in Entities) entity.Update(delta); removeDeadEntities(); inputButtonListener.Update(delta); }
public void Update(Delta delta) { if (CurrentAnimation == null) return; Time += delta.Time; if (Time >= 1.0f / framesPerSecond) { if (++currentAnimationFrameIndex >= CurrentAnimation.Data.Length) currentAnimationFrameIndex = 0; Time = 0.0f; } }