public BlockPlacedEventArgs(Level level, int x, int y, int z, BlockType type) { Level = level; X = x; Y = y; Layer = (Layer)z; Type = type; }
/// <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); }
/// <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); }
public BlockPlacedEventArgs(Level level, int x, int y, Layer layer, BlockType type) : this(level, x, y, (int)layer, type) { }
public LevelDataEventArgs(Level level) { Level = level; Level.Tiles.Generated = true; }
public BlockPlacedEventArgs(Level level, int x, int y, int z, BlockType newType, BlockType oldType) : this(x, y, z, newType, oldType) { Level = level; }
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; }