public Tile(int _x, int _y, TileType _tileType, Graphic _tileGraphic) { width = WIDTH; height = HEIGHT; x = _x; y = _y; tileType = _tileType; tileGraphic = _tileGraphic; rect = new Rectangle (new Point ((int)x, (int)y), new Size (Tile.WIDTH, Tile.HEIGHT)); system = null; }
public virtual void Update(float elapsed, Camera camera, Player player, Map map) { rect = new Rectangle (new Point ((int)x, (int)y), new Size (width, height)); if (health <= 0) { dead = true; } if (dead) { if (system == null) { ParticleOptions ops = (new EffectDie (colour, (KillableSprite)this)).template.Clone(); ops.xPosRange = new Vector (new Point ((int)x, (int)x + width)); ops.yPosRange = new Vector (new Point ((int)y, (int)y + height)); system = new ParticleSystem (ops); } system.Update (elapsed, camera); return; } }