Changeset 11939
- Timestamp:
- May 4, 2018, 11:22:50 PM (7 years ago)
- Location:
- code/branches/3DPacman_FS18/src/modules/pacman
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt
r11915 r11939 4 4 PacmanGelb.cc 5 5 PacmanPointSphere.cc 6 PacmanPointAfraid.cc 6 7 ) 7 8 -
code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
r11933 r11939 65 65 { 66 66 SUPER(Pacman, tick, dt); 67 68 if(!timer){ 69 timer = timer - dt; 70 if(timer<=0){ 71 afraid = false; 72 timer = 0; 73 } 74 } 67 75 68 76 int i = 0; … … 119 127 } 120 128 else{ 121 122 129 for(int nrghost = 0; nrghost<3; ++nrghost){ 123 130 bcolli = collis(ghosts[nrghost]->getPosition(), currentPosition); … … 130 137 void setAfraid(){ 131 138 afraid = true; 139 timer = 10; //Set timer to 10 seconds 132 140 } 133 141 -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
r11933 r11939 27 27 */ 28 28 29 #include "PacmanPoint Sphere.h"29 #include "PacmanPointAfraid.h" 30 30 31 31 #include "core/CoreIncludes.h" … … 34 34 namespace orxonox 35 35 { 36 RegisterClass(PacmanPoint Sphere);36 RegisterClass(PacmanPointAfraid); 37 37 38 38 /** … … 42 42 The creator of this object. 43 43 */ 44 PacmanPoint Sphere::PacmanPointSphere(Context* context) : ControllableEntity(context)44 PacmanPointAfraid::PacmanPointAfraid(Context* context) : ControllableEntity(context) 45 45 { 46 RegisterObject(PacmanPoint Sphere);46 RegisterObject(PacmanPointAfraid); 47 47 this->setCollisionType(CollisionType::None); 48 48 } … … 52 52 Destructor. Destroys controller, if present. 53 53 */ 54 PacmanPoint Sphere::~PacmanPointSphere()54 PacmanPointAfraid::~PacmanPointAfraid() 55 55 { 56 56 // Deletes the controller if the object was initialized and the pointer to the controller is not NULL. … … 61 61 Method for creating a AutonomousDrone through XML. 62 62 */ 63 void PacmanPoint Sphere::XMLPort(Element& xmlelement, XMLPort::Mode mode)63 void PacmanPointAfraid::XMLPort(Element& xmlelement, XMLPort::Mode mode) 64 64 { 65 SUPER(PacmanPoint Sphere, XMLPort, xmlelement, mode);65 SUPER(PacmanPointAfraid, XMLPort, xmlelement, mode); 66 66 } 67 67 68 68 69 void PacmanPoint Sphere::tick(float dt)69 void PacmanPointAfraid::tick(float dt) 70 70 { 71 SUPER(PacmanPoint Sphere, tick, dt);71 SUPER(PacmanPointAfraid, tick, dt); 72 72 } 73 73 74 bool PacmanPoint Sphere::taken(Vector3 playerpos)74 bool PacmanPointAfraid::taken(Vector3 playerpos) 75 75 { 76 76 if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){ … … 83 83 84 84 85 void PacmanPoint Sphere::resetPacmanPointSphere(){85 void PacmanPointAfraid::resetPacmanPointAfraid(){ 86 86 this->setPosition(resetposition); 87 87 } -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h
r11933 r11939 27 27 */ 28 28 29 #ifndef _PacmanPoint Sphere_H__30 #define _PacmanPoint Sphere_H__29 #ifndef _PacmanPointAfraid_H__ 30 #define _PacmanPointAfraid_H__ 31 31 32 32 #include "OrxonoxPrereqs.h" … … 38 38 namespace orxonox { 39 39 40 class _OrxonoxExport PacmanPoint Sphere: public ControllableEntity40 class _OrxonoxExport PacmanPointAfraid : public ControllableEntity 41 41 { 42 42 public: 43 PacmanPoint Sphere(Context* context);44 virtual ~PacmanPoint Sphere();43 PacmanPointAfraid(Context* context); 44 virtual ~PacmanPointAfraid(); 45 45 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML. … … 48 48 49 49 bool taken(Vector3 playerpos); 50 void resetPacmanPoint Sphere();50 void resetPacmanPointAfraid(); 51 51 private: 52 52
Note: See TracChangeset
for help on using the changeset viewer.