Esempio n. 1
0
        protected override void LoadContent()
        {
            keyboardState = new KeyboardState(); 

            spriteBatch = new SpriteBatch(GraphicsDevice);
                       

            tileMap = new TileMap(mapSize, seed, true);
            tileMap.LoadContent(Content);

            player = new Player(tileMap.playerStart);
            player.LoadContent(Content);
      
            tileObjectManagement = new TileObjectManagement(this);
            quarryManagement = new QuarryManagement(); 
            gui.LoadContnent(Content, GraphicsDevice);

            rectangleTexture = new Texture2D(GraphicsDevice, 1, 1);
            rectangleTexture.SetData(new[] { Color.White });

        }
Esempio n. 2
0
 public void Update(GameTime gameTime, Player player, TileObjectManagement tileManagement, Game1 game)
 {
     game1         = game1;
     keyboardState = Keyboard.GetState();
     if (keyboardState.IsKeyDown(Keys.L) && oldKeyboardState.IsKeyUp(Keys.L))
     {
         showDebug = !showDebug;
     }
     if (showDebug)
     {
         if (keyboardState.IsKeyDown(Keys.K) && oldKeyboardState.IsKeyUp(Keys.K))
         {
             showChunks = !showChunks;
         }
     }
     oldKeyboardState = keyboardState;
     if (showDebug)
     {
         playerPos = "Position " + player.CurrentBounds().ToString();
         inAir     = "In Air " + player.jumping.ToString();
         canBreak  = "Can Break " + player.canBreak.ToString();
         velocity  = "Velocity " + player.velocity.ToString();
         colliding = "Colliding " + player.colliding.ToString();
         try
         {
             fps = "fps " + Convert.ToInt32(game._fps).ToString();
         }
         catch (Exception ex)
         {
         }
         tilePos  = "Tile Position " + ((player.rect.X % 1024) / 32).ToString() + " " + (((player.rect.Y % 1024) / 32) + 2).ToString();
         entitys  = "Entitys " + tileManagement.tileObjects.Count;
         chunkPos = "Chunk X:" + (int)(player.position.X / 1024) + " Chunk Y:" + (int)(player.position.Y / 1024);
         // acceleration = "Acceleration: " + player.physics.acceleration;
     }
 }