65 virtual void tick(
float dt)
override;
75 { this->fieldWidth_ = width; this->fieldHeight_ = height; }
81 { this->setFieldDimension(dimension.x, dimension.y); }
87 {
return Vector2(this->fieldWidth_, this->fieldHeight_); }
89 void setSpeed(
float speed);
95 {
return this->speed_; }
102 { this->accelerationFactor_ = factor; }
108 {
return this->accelerationFactor_; }
115 { this->batlength_ = batlength; }
121 {
return this->batlength_; }
128 void setDefScoreSound(
const std::string& engineSound);
130 void setDefBatSound(
const std::string& engineSound);
132 void setDefBoundarySound(
const std::string& engineSound);
136 void registerVariables();
float fieldWidth_
The width of the playing field.
Definition: PongBall.h:138
Vector2 getFieldDimension() const
Get the dimensions of the playing field.
Definition: PongBall.h:86
float getAccelerationFactor() const
Get the acceleration factor of the ball.
Definition: PongBall.h:107
The WorldSound class is to be used for sounds with position and orientation.
Definition: WorldSound.h:44
float getSpeed() const
Get the speed of the ball (in x-direction).
Definition: PongBall.h:94
::std::string string
Definition: gtest-port.h:756
float getBatLength() const
Get the length of the bats.
Definition: PongBall.h:120
bool bDeleteBats_
Bool, to keep track, of whether this->bat_ exists or not.
Definition: PongBall.h:144
Definition: MovableEntity.h:42
float relMercyOffset_
Offset, that makes the player not loose, when, in all fairness, he would have.
Definition: PongBall.h:146
float accelerationFactor_
The acceleration factor of the ball.
Definition: PongBall.h:141
WeakPtr< PongBat > * bat_
An array with the two bats.
Definition: PongBall.h:143
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
float fieldHeight_
The height of the playing field.
Definition: PongBall.h:139
static const float MAX_REL_Z_VELOCITY
Definition: PongBall.h:126
void setAccelerationFactor(float factor)
Set the acceleration factor of the ball.
Definition: PongBall.h:101
xmlelement
Definition: Super.h:519
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
WorldSound * defBatSound_
Definition: PongBall.h:148
WorldSound * defScoreSound_
Definition: PongBall.h:147
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
float batlength_
The length of the bats (in z-direction) as percentage of the height of the playing field...
Definition: PongBall.h:142
void setFieldDimension(float width, float height)
Set the dimensions of the playing field.
Definition: PongBall.h:74
void setBatLength(float batlength)
Set the length of the bats.
Definition: PongBall.h:114
This class manages the ball for Pong.
Definition: PongBall.h:59
void setFieldDimension(const Vector2 &dimension)
Get the dimensions of the playing field.
Definition: PongBall.h:80
unsigned int * batID_
The object IDs of the bats, to be able to synchronize them over the network.
Definition: PongBall.h:145
WorldSound * defBoundarySound_
Definition: PongBall.h:149
#define _PongExport
Definition: PongPrereqs.h:60
float speed_
The speed (in x-direction) of the ball.
Definition: PongBall.h:140
Shared library macros, enums, constants and forward declarations for the pong module ...