enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/src actors.cc,1.52,1.53


From: Daniel Heck <address@hidden>
Subject: [Enigma-cvs] enigma/src actors.cc,1.52,1.53
Date: Wed, 26 Nov 2003 08:08:25 +0000

Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv8558/src

Modified Files:
        actors.cc 
Log Message:
- (ActorInfo) Removed unused ctor arguments.
- Cannonball does not rebound from stones


Index: actors.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/actors.cc,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** actors.cc   20 Nov 2003 20:18:04 -0000      1.52
--- actors.cc   26 Nov 2003 08:08:23 -0000      1.53
***************
*** 39,43 ****
  
  Actor::Actor(const char *kind)
! : Object(kind), actorinfo(V2(), V2()),
    m_sprite(),
    startingpos(), 
--- 39,44 ----
  
  Actor::Actor(const char *kind)
! : Object(kind), 
!   actorinfo(),
    m_sprite(),
    startingpos(), 
***************
*** 369,375 ****
          st->actor_inside(this);
  
!     // 'inside_collision' is true when the actor bounces back from a stone.
!     // At that moment it may have a position where it overlaps with the stone,
!     // so overlap checking would "shatter" marbles.
  
      if (!inside_collision) {
--- 370,376 ----
          st->actor_inside(this);
  
!     // 'inside_collision' is true when the actor bounces back from a
!     // stone.  At that moment it may have a position where it overlaps
!     // with the stone, so overlap checking would "shatter" marbles.
  
      if (!inside_collision) {
***************
*** 549,581 ****
      public:
          CannonBall() : Actor ("ac-cannonball") {
          }
          bool is_flying() const { return true; }
          bool is_dead() const { return false; }
          bool is_on_floor() const { return false; }
  
!         // ModelCallback interface.
!         void animcb() {
!             GridPos p (get_pos());
  
!             if (Stone *st = GetStone (p)) {
!                 SendMessage (st, "explode");
!             }
!             else if (Floor *fl = GetFloor(p)) {
!                 if (fl->is_destroyable())
!                     SetItem (p, MakeItem ("it-explosion3"));
!             }
!             KillActor (this);
!         }
  
!         void on_creation(const px::V2 &p) {
!             Actor::on_creation(p);
  
!             display::SpriteHandle &sprite = get_sprite();
!             sprite.kill();
!             sprite = display::AddEffect(p, "ac-cannonball");
!             sprite.set_callback(this);
!         }
!     };
  }
  
  
--- 550,586 ----
      public:
          CannonBall() : Actor ("ac-cannonball") {
+             get_actorinfo()->ignore_contacts = true;
          }
          bool is_flying() const { return true; }
          bool is_dead() const { return false; }
          bool is_on_floor() const { return false; }
+         void on_creation(const px::V2 &p);
  
!         void animcb();
!     };
! }
  
! void CannonBall::animcb() {
!     GridPos p (get_pos());
  
!     if (Stone *st = GetStone (p)) {
!         SendMessage (st, "explode");
!     }
!     else if (Floor *fl = GetFloor(p)) {
!         if (fl->is_destroyable())
!             SetItem (p, MakeItem ("it-explosion3"));
!     }
!     KillActor (this);
! }
  
! void CannonBall::on_creation(const px::V2 &p) {
!     Actor::on_creation(p);
! 
!     display::SpriteHandle &sprite = get_sprite();
!     sprite.kill();
!     sprite = display::AddEffect(p, "ac-cannonball");
!     sprite.set_callback(this);
  }
+ 
  
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]