예제 #1
0
 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();
 }
예제 #2
0
 public Bullet(Vector2 position, Vector2 velocity, float width)
 {
     _field = EntitiesOfType<Field>().Single();
     _position = position;
     _velocity = velocity;
     _width = width;
 }
예제 #3
0
 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();
 }
예제 #4
0
 private void Respawn()
 {
     _location = EntitiesOfType<Field>().Single().FindRespawnPoint(-0.8f);
 }
예제 #5
0
 public Powerup(PowerupType type)
 {
     _type = type;
     _location = EntitiesOfType<Field>().Single().FindRespawnPoint(-0.7f);
 }
예제 #6
0
 public Smoke(Field field, Vector2 position, Vector2 velocity)
 {
     _field = field;
     _position = position;
     _velocity = velocity;
 }