public override void Update(GameTime gameTime) { animation.Update(gameTime); Region = animation.CurrentFrame; if (animation.IsComplete) { Destroy(); } }
public void Update() { m_animation.Update(); m_popAction.Update(); _freeSpinTimer -= (float)Globals.TheGame.ElapsedTime; if (_freeSpinTimer < 0 && _generation.FreeSpin) { _generation.FreeSpin = false; _section.FreeSpin = false; } }
public override void Update(GameTime gameTime) { stateTime += gameTime.ElapsedGameTime.Milliseconds; flip = owner.MotionEngine.GoalVelocityX > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; if (brain.HasStates) { brain.CurrentState(); } else { brain.PushState(Idle); effect.Play(); } animation.Update(gameTime); }
public override void Update() { if (TouchInput.IsScreenTapped) { m_attackPosition = Vector2.Transform(TouchInput.TouchPosition, Matrix.Invert(World.cam_Main.CameraMatrix)); m_transform.Position = m_attackPosition; DestructibleComponent.DestructibleColliders[(int)AttackType.Shuriken].DoCollision(m_pointCollider, null); m_animation.Start(); float halfScreenWidth = Globals.TheGame.ScreenWidth * 0.5f; //float screenHeight = Globals.TheGame.ScreenHeight; float ratio = (TouchInput.TouchPosition.X - halfScreenWidth) / halfScreenWidth; m_transform.Direction = -1 * ratio + (float)(Globals.Random.NextDouble() - 0.5f) * 0.5f; m_transform.PosY += Globals.Random.Next(-10, 10); } m_animation.Update(); }
public override void Update() { bool test; if (Globals.kbs.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.C) && m_transform.PosY < -5) { test = true; } m_circleCollider.Update(); m_physics.Update(); m_animation.Update(); if (_isPickedUp) { Transform.PosY += PickUpVelocity; Transform.SclX = Transform.SclY = Transform.SclX * 1.075f; if (m_sprite.Alpha - AlphaDecrement > 0) { m_sprite.Alpha -= AlphaDecrement; } else { //CoinPiles.AddCoin(_type); m_sprite.Alpha = 0; } } bool removeMe = m_sprite.Alpha == 0; if (removeMe) { ClearLists(); } }
protected override void Update(GameTime gameTime) { var deltaSeconds = (float)gameTime.ElapsedGameTime.TotalSeconds; var keyboardState = Keyboard.GetState(); // motw if (keyboardState.IsKeyDown(Keys.W)) { _motwSprite.Play("walkNorth"); } if (keyboardState.IsKeyDown(Keys.A)) { _motwSprite.Play("walkWest"); } if (keyboardState.IsKeyDown(Keys.S)) { _motwSprite.Play("walkSouth"); } if (keyboardState.IsKeyDown(Keys.D)) { _motwSprite.Play("walkEast"); } // camera if (keyboardState.IsKeyDown(Keys.R)) { Camera.ZoomIn(deltaSeconds); } if (keyboardState.IsKeyDown(Keys.F)) { Camera.ZoomOut(deltaSeconds); } // zombie if (keyboardState.IsKeyDown(Keys.Left)) { _zombie.Walk(-1.0f); } if (keyboardState.IsKeyDown(Keys.Right)) { _zombie.Walk(1.0f); } if (keyboardState.IsKeyDown(Keys.Space)) { _zombie.Attack(); } //if (keyboardState.IsKeyDown(Keys.Up)) // _zombie.Jump(); if (keyboardState.IsKeyDown(Keys.Enter)) { _zombie.Die(); } // update must be called before collision detection _zombie.Update(gameTime); //_world.Update(gameTime); Camera.LookAt(_zombie.Position); _animation.Update(deltaSeconds); _fireballSprite.TextureRegion = _animation.CurrentFrame; _motwSprite.Update(deltaSeconds); base.Update(gameTime); }
public void Update() { m_spriteAnimation.Update(); }
public override void Update() { m_animation.Update(); m_physics.Update(); m_moveTo.Update(); }
public void Update() { m_animation.Update(); }