Ejemplo n.º 1
0
 public WaterBullet( string spr, int x, int y )
 {
     pos = new Vector2( x, y );
     realpos = (Vector2f)pos;
     sprite = "~";
     color = 1;
 }
Ejemplo n.º 2
0
 public ExplodeyBullet( string spr, int x, int y )
 {
     pos = new Vector2( x, y );
     realpos = (Vector2f)pos;
     // Heh, unicode BULLET ;)
     color = 5;
     sprite = "*";
     attrs = Attrs.BOLD;
 }
Ejemplo n.º 3
0
 public override void Update( double dt )
 {
     realpos = realpos + direction;
     pos = (Vector2)realpos;
     Dingo dog = World.GetDog( pos );
     if ( dog != null ) {
         dog.Kill();
         Kill();
         return;
     }
     if ( !World.Passable( pos ) ) {
         Kill();
         return;
     }
 }
Ejemplo n.º 4
0
 public override void Update( double dt )
 {
     realpos = realpos + direction;
     pos = (Vector2)realpos;
     Dingo dog = World.GetDog( pos );
     if ( dog != null ) {
         dog.Kill();
         World.AddDynamicEntity( new Explosion( "*", pos.x, pos.y ) );
         Kill();
         return;
     }
     if ( !World.Passable( pos ) ) {
         World.AddDynamicEntity( new Explosion( "*", pos.x, pos.y ) );
         Kill();
         return;
     }
 }
Ejemplo n.º 5
0
 public void Shoot( Vector2f dir )
 {
     switch( gun ) {
         case "Water Gun": {
             WaterBullet b = new WaterBullet( "~", pos.x, pos.y );
             b.direction = dir;
             World.AddDynamicEntity( b );
             break;
                           }
         case "Cannon Gun": {
             Bullet b = new Bullet( "~", pos.x, pos.y );
             b.direction = dir;
             World.AddDynamicEntity( b );
             break;
                           }
         case "Confetti Gun": {
             ExplodeyBullet b = new ExplodeyBullet( "*", pos.x, pos.y );
             b.direction = dir;
             World.AddDynamicEntity( b );
             break;
                           }
     }
 }
Ejemplo n.º 6
0
 public double Distance( Vector2f b )
 {
     double dx = x-b.x;
     double dy = y-b.y;
     return Math.Sqrt( dx*dx + dy*dy );
 }