protected override void Tick(Graphics graphics, Rectangle camera) { _position += _velocity * World.DeltaSeconds; graphics.DrawEllipse(Pen, _position.X - _width / 2.0f - camera.X, _position.Y - _width / 2.0f - camera.Y, _width, _width); if (_field.IsOnGrid(_position) == false || _field[(int)_position.X, (int)_position.Y]) Die(); }
public Bullet(Vector2 position, Vector2 velocity, float width) { _field = EntitiesOfType<Field>().Single(); _position = position; _velocity = velocity; _width = width; }
protected override void Tick(Graphics graphics, Rectangle camera) { _position += _velocity * World.DeltaSeconds; var width = (_frame++ + 10) / 10.0f; graphics.DrawEllipse(Pen, _position.X - width / 2.0f - camera.X, _position.Y - width / 2.0f - camera.Y, width, width); if (_frame > 100 || _field[(int)_position.X, (int)_position.Y]) Die(); }
private void Respawn() { _location = EntitiesOfType<Field>().Single().FindRespawnPoint(-0.8f); }
public Powerup(PowerupType type) { _type = type; _location = EntitiesOfType<Field>().Single().FindRespawnPoint(-0.7f); }
public Smoke(Field field, Vector2 position, Vector2 velocity) { _field = field; _position = position; _velocity = velocity; }