public void Update(Starve g, GameTime gameTime) { foreach (IEntity entity in entities) { entity.Update(g, gameTime); } }
public void Update(Starve g) { Input(g); Zoom = MathHelper.Clamp(Zoom, 0.0f, 10.0f); Rotation = ClampAngle(Rotation); Transform = Matrix.CreateRotationZ(Rotation) * Matrix.CreateScale(new Vector3(Zoom, Zoom, 1)) * Matrix.CreateTranslation(Position.X, Position.Y, 0); InverseTransform = Matrix.Invert(Transform); }
public virtual void Input(Starve g) { mState = Mouse.GetState(); keyState = Keyboard.GetState(); if (mState.ScrollWheelValue > scroll) { Zoom += 0.1f; scroll = mState.ScrollWheelValue; } else if (mState.ScrollWheelValue < scroll) { Zoom -= 0.1f; scroll = mState.ScrollWheelValue; } if (g.InManager.IsKeyPressed(Keys.Up)) { position.Y += 10; } }
private void Input(Starve g) { if (g.InManager.IsKeyPressed(Keys.W)) { Position = new Vector2(Position.X, Position.Y - 10); } if (g.InManager.IsKeyPressed(Keys.A)) { Position = new Vector2(Position.X - 10, Position.Y); } if (g.InManager.IsKeyPressed(Keys.S)) { Position = new Vector2(Position.X, Position.Y + 10); } if (g.InManager.IsKeyPressed(Keys.D)) { Position = new Vector2(Position.X + 10, Position.Y); } }
static void Main() { using (var game = new Starve()) game.Run(); }
public void Update(Starve g, GameTime gameTime) { Input(g); }
public void Update(Starve g, GameTime gameTime) { }