Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2009, 5:05:17 PM (15 years ago)
Author:
dafrick
Message:

Hopefully merged trunk successfully into pickup branch.

Location:
code/branches/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup

  • code/branches/pickup/src/modules/pong/Pong.cc

    r5781 r5935  
    3030
    3131#include "core/CoreIncludes.h"
     32#include "core/EventIncludes.h"
    3233#include "core/Executor.h"
    3334#include "PongCenterpoint.h"
     
    3940namespace orxonox
    4041{
     42    CreateEventName(PongCenterpoint, right);
     43    CreateEventName(PongCenterpoint, left);
     44   
    4145    CreateUnloadableFactory(Pong);
    4246
     
    5256        this->setHUDTemplate("PongHUD");
    5357
    54         this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall)));
     58        this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&Pong::startBall, this)));
    5559        this->starttimer_.stopTimer();
    5660
     
    7276            this->ball_->setFieldDimension(this->center_->getFieldDimension());
    7377            this->ball_->setSpeed(0);
     78            this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());
    7479            this->ball_->setBatLength(this->center_->getBatLength());
    7580
     
    120125        if (this->ball_)
    121126        {
    122             delete this->ball_;
     127            this->ball_->destroy();
    123128            this->ball_ = 0;
    124129        }
     
    155160        if (this->center_)
    156161        {
    157             this->center_->fireEvent();
    158 
     162            if (player == this->getRightPlayer())
     163                this->center_->fireEvent(FireEventName(PongCenterpoint, right));
     164            else if (player == this->getLeftPlayer())
     165                this->center_->fireEvent(FireEventName(PongCenterpoint, left));
     166           
    159167            if (player)
    160                 this->gtinfo_.sendAnnounceMessage(player->getName() + " scored");
     168                this->gtinfo_->sendAnnounceMessage(player->getName() + " scored");
    161169        }
    162170
     
    165173            this->ball_->setPosition(Vector3::ZERO);
    166174            this->ball_->setVelocity(Vector3::ZERO);
     175            this->ball_->setAcceleration(Vector3::ZERO);
    167176            this->ball_->setSpeed(0);
    168177        }
Note: See TracChangeset for help on using the changeset viewer.