Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2019, 4:17:26 PM (5 years ago)
Author:
ahuwyler
Message:

Class Wall is created

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc

    r12212 r12278  
    170170                    // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%)
    171171                    distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
     172                   
     173
    172174                    if (fabs(distance) <= 1) // If the bat is there to parry.
    173175                    {
     
    183185                        this->fireEvent();
    184186                    }
     187
    185188                    // If the left player scores.
    186189                    else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    187190                    {
     191                        ChatManager::message("You suck!!");
    188192                        defScoreSound_->play();//play score sound
    189193                        if (this->getGametype() && this->bat_[0])
    190194                        {
     195                            ChatManager::message("You suck!!");
     196
     197
    191198                            this->getGametype()->playerScored(this->bat_[0]->getPlayer());
    192199                            return;
    193200                        }
    194201                    }
     202
     203
     204
     205
     206
    195207                }
    196208                // If the left boundary has been crossed.
     
    218230                        if (this->getGametype() && this->bat_[1])
    219231                        {
     232                            ChatManager::message("You suck!!");
     233
    220234                            this->getGametype()->playerScored(this->bat_[1]->getPlayer());
    221235                            return;
Note: See TracChangeset for help on using the changeset viewer.