Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 6, 2009, 4:57:53 AM (16 years ago)
Author:
landauf
Message:

Using named events in Pong. Also firing events in PongBall now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/modules/pong/PongBall.cc

    r5885 r5889  
    102102        {
    103103            velocity.z = -velocity.z;
    104             if (GameMode::playsSound())
    105                 this->sidesound_->play();
    106 
    107104            if (position.z > this->fieldHeight_ / 2)
    108105                position.z = this->fieldHeight_ / 2;
    109106            if (position.z < -this->fieldHeight_ / 2)
    110107                position.z = -this->fieldHeight_ / 2;
     108
     109            this->fireEvent();
     110            if (GameMode::playsSound())
     111                this->sidesound_->play();
    111112        }
    112113
     
    125126                        velocity.x = -velocity.x;
    126127                        velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
     128                       
     129                        this->fireEvent();
    127130                        if (GameMode::playsSound())
    128131                            this->batsound_->play();
     
    147150                        velocity.x = -velocity.x;
    148151                        velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
     152
     153                        this->fireEvent();
    149154                        if (GameMode::playsSound())
    150155                            this->batsound_->play();
Note: See TracChangeset for help on using the changeset viewer.