Exemplo n.º 1
0
 public BlockPlacedEventArgs(Level level, int x, int y, int z, BlockType type)
 {
     Level = level;
     X     = x;
     Y     = y;
     Layer = (Layer)z;
     Type  = type;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values. (Delta time)</param>
        protected override void Update(GameTime gameTime)
        {
            UI.Update(gameTime);

            if (State == GameState.Game)
            {
                Level?.Update(gameTime);
            }

            base.Update(gameTime);
        }
Exemplo n.º 3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values. (Delta time)</param>
        protected override void Draw(GameTime gameTime)
        {
            UI.BeginDraw(gameTime);
            GraphicsDevice.Clear(Color.Black);

            if (State == GameState.Game)
            {
                SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                Level?.Draw(SpriteBatch, gameTime);
                SpriteBatch.End();
            }

            UI.EndDraw();

            base.Draw(gameTime);
        }
Exemplo n.º 4
0
 public BlockPlacedEventArgs(Level level, int x, int y, Layer layer, BlockType type)
     : this(level, x, y, (int)layer, type)
 {
 }
Exemplo n.º 5
0
 public LevelDataEventArgs(Level level)
 {
     Level = level;
     Level.Tiles.Generated = true;
 }
Exemplo n.º 6
0
 public BlockPlacedEventArgs(Level level, int x, int y, int z, BlockType newType, BlockType oldType) : this(x, y, z, newType, oldType)
 {
     Level = level;
 }
Exemplo n.º 7
0
 public BlockPlacedEventArgs(Player sender, int x, int y, int z, BlockType newType, BlockType oldType) : this(x, y, z, newType, oldType)
 {
     Sender = sender;
     Level  = (Level)sender.Level;
 }