Esempio n. 1
0
 public override void Collide( IWorldDrawable worldDrawable )
 {
     if( worldDrawable is Bullet || worldDrawable is Ship )
         return;
     Done = true;
     EffectHandler.Instance.Trigger( Effect.Explosion, worldDrawable.Position );
 }
Esempio n. 2
0
 public void Collide( IWorldDrawable worldDrawable )
 {
     if( worldDrawable is Ship )
     {
         World.Instance.Score += 10;
         World.Instance.AddMessage( "+10", Position );
         Done = true;
     }
 }
Esempio n. 3
0
 public void Collide( IWorldDrawable worldDrawable )
 {
     if( worldDrawable is Ship )
     {
         var s = (Ship) worldDrawable;
         Apply( s );
         Done = true;
     }
 }
Esempio n. 4
0
 public override void Collide( IWorldDrawable worldDrawable )
 {
     if( worldDrawable is Bullet )
         return;
     if( worldDrawable is Rock )
     {
         EffectHandler.Instance.Trigger( Effect.Explosion, Position );
         SpaceGame.Instance.End( World.Instance.Score );
     }
 }
Esempio n. 5
0
 public override void Collide( IWorldDrawable worldDrawable )
 {
     if( worldDrawable is Rock )
         return;
     Done = true;
     SoundManager.Explode().Play();
     if( worldDrawable is Bullet )
         World.Instance.Score += (int) ( ( 1.0 / _size ) * 100.0 );
     if( _size > 30 )
     {
         World.Instance.AddDrawable( new Rock( _size / 2, Position, Rnd.Vector( -1, 1, -1, 1 ), Speed * 2 ) );
         World.Instance.AddDrawable( new Rock( _size / 2, Position, Rnd.Vector( -1, 1, -1, 1 ), Speed * 4 ) );
         World.Instance.AddDrawable( new Rock( _size / 2, Position, Rnd.Vector( -1, 1, -1, 1 ), Speed * 5 ) );
     }
 }
Esempio n. 6
0
 public abstract void Collide( IWorldDrawable worldDrawable );
Esempio n. 7
0
        bool Intersects( IWorldDrawable first, IWorldDrawable second )
        {
            var dist = ( first.Position - second.Position ).LengthSquared();
            var objspan = ( first.Size + second.Size ).LengthSquared() / 4.8;

            return dist < objspan;
        }
Esempio n. 8
0
 public void AddDrawable( IWorldDrawable drawable )
 {
     _addnext.Add( drawable );
 }