Esempio n. 1
0
 public void Update(Starve g, GameTime gameTime)
 {
     foreach (IEntity entity in entities)
     {
         entity.Update(g, gameTime);
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
 static void Main()
 {
     using (var game = new Starve())
         game.Run();
 }
Esempio n. 6
0
 public void Update(Starve g, GameTime gameTime)
 {
     Input(g);
 }
Esempio n. 7
0
 public void Update(Starve g, GameTime gameTime)
 {
 }