예제 #1
0
 public void Update(Camera camera)
 {
     prevMouseState    = currentMouseState;
     currentMouseState = Mouse.GetState();
     if (currentMouseState.LeftButton == ButtonState.Pressed && prevMouseState.LeftButton == ButtonState.Released)
     {
         // Transfrom to World coords
         Vector2 worldPosition = Vector2.Transform(new Vector2(currentMouseState.X, currentMouseState.Y), Matrix.Invert(camera.Transform));
         SpawnCrate(worldPosition.X);
         hud.DecreaseMana(20);
     }
     if (Keyboard.GetState().IsKeyDown(Keys.Space))
     {
         SpawnBrick();
     }
 }