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

Diff of /enigma/src/actors.cc

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

revision 1.9 by dheck, Thu Mar 13 18:00:51 2003 UTC revision 1.10 by dheck, Fri Apr 4 21:14:33 2003 UTC
# Line 54  Actor::add_force (const px::V2 &f) Line 54  Actor::add_force (const px::V2 &f)
54      actorinfo.forceacc += f;      actorinfo.forceacc += f;
55  }  }
56    
   
57  void  void
58  Actor::init()  Actor::init()
59  {  {
# Line 147  Actor::set_model(const string &name) Line 146  Actor::set_model(const string &name)
146  namespace  namespace
147  {  {
148      class Rotor : public Actor {      class Rotor : public Actor {
149            CLONEACTOR(Rotor);
150      public:      public:
151          Rotor();          Rotor();
152      private:      private:
153          // Actor interface.          // Actor interface.
154          bool is_dead() { return false; }          bool is_dead() { return false; }
   
         // Object interface.  
         Object* clone() { return new Rotor; }  
         void dispose() { delete this; }  
155      };      };
156  }  }
157    
158  Rotor::Rotor()  Rotor::Rotor()
159      : Actor("ac-rotor", V2())  : Actor("ac-rotor", V2())
160  {  {
161      world::ActorInfo *ai = get_actorinfo();      world::ActorInfo *ai = get_actorinfo();
162      ai->radius = 20/64.0;      ai->radius = 20/64.0;
# Line 222  namespace Line 218  namespace
218  }  }
219    
220  BasicBall::BasicBall(const char *kind, double radius, double mass)  BasicBall::BasicBall(const char *kind, double radius, double mass)
221  : Actor(kind, V2()),  : Actor(kind, V2()), state(NO_STATE)
   state(NO_STATE)  
222  {  {
223      world::ActorInfo *ai = get_actorinfo();      world::ActorInfo *ai = get_actorinfo();
224      ai->radius = radius;      ai->radius = radius;
# Line 355  BasicBall::change_state(State newstate) Line 350  BasicBall::change_state(State newstate)
350  namespace  namespace
351  {  {
352      class BlackBall : public BasicBall {      class BlackBall : public BasicBall {
353          CLONEOBJ(BlackBall);          CLONEACTOR(BlackBall);
354      public:      public:
355          BlackBall() : BasicBall("ac-blackball", 19.0/64.0, 1.0)          BlackBall() : BasicBall("ac-blackball", 19.0/64.0, 1.0)
356          {          {
# Line 366  namespace Line 361  namespace
361      };      };
362    
363      class WhiteBall : public BasicBall {      class WhiteBall : public BasicBall {
364          CLONEOBJ(WhiteBall);          CLONEACTOR(WhiteBall);
365      public:      public:
366          WhiteBall() : BasicBall("ac-whiteball", 19.0/64.0, 1.0)          WhiteBall() : BasicBall("ac-whiteball", 19.0/64.0, 1.0)
367          {          {
# Line 377  namespace Line 372  namespace
372      };      };
373    
374      class WhiteBall_Small : public BasicBall {      class WhiteBall_Small : public BasicBall {
375          CLONEOBJ(WhiteBall_Small);          CLONEACTOR(WhiteBall_Small);
376      public:      public:
377          WhiteBall_Small() : BasicBall("ac-whiteball-small", 13/64.0, 0.7)          WhiteBall_Small() : BasicBall("ac-whiteball-small", 13/64.0, 0.7)
378          {}          {}

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

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