/[enigma]/enigma/src/stones.cc
ViewVC logotype

Diff of /enigma/src/stones.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by reallysoft, Sat May 31 10:02:50 2003 UTC revision 1.11 by reallysoft, Wed Jun 4 12:56:57 2003 UTC
# Line 71  namespace Line 71  namespace
71      };      };
72  }  }
73    
 namespace  
 {  
     class BrakeStone : public Stone {  
         CLONEOBJ(BrakeStone);  
     public:  
         BrakeStone() : Stone("st-brake") {}  
   
         void on_creation() {  
             Stone::on_creation();  
   
             GridPos  p  = get_pos();  
             Item    *it = GetItem(p);  
             if (it && 0 == strcmp(it->get_kind(), "it-blocker")) {  
                 KillItem(p);  
                 play_sound("explosion1");  
             }  
         }  
   
         StoneResponse collision_response(const StoneContact &/*sc*/) {  
             return STONE_PASS;  
         }  
   
         void actor_inside(Actor *a) {  
             const double BRAKE_RADIUS = 0.3;  
             GridPos      p            = get_pos();  
             double       dist         = length(a->get_pos() - p.center());  
   
             if (dist < BRAKE_RADIUS) {  
                 player::PickupStoneAsItem(a, p);  
             }  
         }  
   
          bool on_laserhit(Direction) {  
              GridPos p = get_pos();  
              KillStone(p);  
              SetItem(p, MakeItem("it-explosion1"));  
              return false;      // block laser  
          }  
     };  
 }  
   
74  // --------------------------------------------------------------------------------  // --------------------------------------------------------------------------------
75    
76  void stones::Init()  void stones::Init()
77  {  {
78      // Register(new ...);      // Register(new ...);
79    
     Register(new BrakeStone);  
80      Register(new ElectricStone);      Register(new ElectricStone);
81    
82      // Init stones from stones_simple.cc and stones_complex.cc:      // Init stones from stones_simple.cc and stones_complex.cc:

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26