public override void Collide( IWorldDrawable worldDrawable ) { if( worldDrawable is Bullet || worldDrawable is Ship ) return; Done = true; EffectHandler.Instance.Trigger( Effect.Explosion, worldDrawable.Position ); }
public void Collide( IWorldDrawable worldDrawable ) { if( worldDrawable is Ship ) { World.Instance.Score += 10; World.Instance.AddMessage( "+10", Position ); Done = true; } }
public void Collide( IWorldDrawable worldDrawable ) { if( worldDrawable is Ship ) { var s = (Ship) worldDrawable; Apply( s ); Done = true; } }
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 ); } }
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 ) ); } }
public abstract void Collide( IWorldDrawable worldDrawable );
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; }
public void AddDrawable( IWorldDrawable drawable ) { _addnext.Add( drawable ); }