Changeset 11669 for code/branches/Asteroid_HS17/src/modules
- Timestamp:
- Dec 13, 2017, 11:32:26 AM (7 years ago)
- Location:
- code/branches/Asteroid_HS17/src/modules/asteroids2D
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc
r11668 r11669 35 35 TODO: 36 36 - Implement a counting system for the score 37 - HUD can be improved (display health, points, level etc.) 38 - Projectiles still fly in a mysterious direction 37 - HUD can be improved (display health, points, level etc. 39 38 - Problem: The asteroids spawn randomly on the playing field. 40 39 During spawn or level up, there is the possibility that they pawn at the position of the ship. 41 40 ->spawn somewhere with a safty distance/radius 41 - look over collisionshapes of the stones -> sometimes collison with stone is not triggered for bigger stones 42 - modify parameters in data/levels/templates/spaceshipAsteroids2D.oxt for a better playing experience -> mass, damping, rotation etc. 43 44 IDEAS: 45 - make Asteroids more beautiful! (setting, ship, explosion particles, stones) 46 - particle effect after you got hit -> during bImmune is true 47 - implement shield -> object that can be triggered 48 - Projectiles should also move over the boarders and appear on the other side 49 -> they can also hurt the player 42 50 43 51 */ -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h
r11668 r11669 35 35 - spawns stones in every level up 36 36 - if you shoot and hit a stone, it will spit into two smaller stones 37 -38 37 @ingroup Asteroids2D 39 38 */ … … 56 55 #include "gamestates/GSLevel.h" 57 56 #include "chat/ChatManager.h" 58 #include <vector>59 57 60 58 // ! HACK … … 109 107 int multiplier; 110 108 109 111 110 private: 112 111 -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.cc
r11660 r11669 51 51 this->height_ = 646; 52 52 } 53 54 53 55 /** 54 56 @brief -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc
r11645 r11669 21 21 * 22 22 * Author: 23 * Florian Zinggeler23 * Viviane Yang 24 24 * 25 25 */ … … 41 41 42 42 this->Asteroids2DGame = nullptr; 43 //this->Ship = nullptr;44 43 this->bShowPoints_ = true; 45 this->bShowHealth_ = true;46 44 } 47 45 … … 77 75 } 78 76 79 /*if(this->bShowHealth_)80 {81 const std::string& health = multi_cast<std::string>(this->Ship->getHealth());82 if (this->Asteroids2DGame->lives <= 0)83 {84 setTextSize(0.2);85 setPosition(Vector2(0.1, 0.02));86 this->setCaption("Final score:\n" + health);87 this->setColour(ColourValue(1, 0, 0, 1));88 }89 else90 {91 setTextSize(0.04);92 setPosition(Vector2(0.2, 0.02));93 this->setColour(ColourValue(1, 1, 1, 1));94 this->setCaption(health);95 }96 }*/97 77 } 98 78 … … 101 81 SUPER(Asteroids2DHUDinfo, changedOwner); 102 82 103 if (this->getOwner() && this->getOwner()->getGametype()) //&& this->getOwner->getPlayer())83 if (this->getOwner() && this->getOwner()->getGametype()) 104 84 { 105 85 this->Asteroids2DGame = orxonox_cast<Asteroids2D*>(this->getOwner()->getGametype()); 106 //this->Ship = orxonox_cast<Asteroids2DShip*>(this->getOwner()->getPlayer()); 86 107 87 } 108 88 else -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h
r11645 r11669 21 21 * 22 22 * Author: 23 * Florian Zinggeler 23 * Viviane Yang 24 * 25 * TODO: - get information for lives and level from gametype 26 * - implement it as you did for points 24 27 * 25 28 */ … … 53 56 { return this->bShowPoints_; } 54 57 55 inline void setShowHealth(bool value)56 { this->bShowHealth_ = value; }57 inline bool getShowHealth() const58 { return this->bShowHealth_; }59 60 58 61 59 private: … … 64 62 bool bShowLevel_; 65 63 bool bShowPoints_; 66 bool bShowHealth_; 64 67 65 68 66 }; -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DPrereqs.h
r11593 r11669 21 21 * 22 22 * Author: 23 * Florian Zinggeler23 * Viviane Yang 24 24 * Co-authors: 25 25 * ... -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DStone.cc
r11668 r11669 120 120 void Asteroids2DStone::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 121 121 { 122 if (getGame() && orxonox_cast<Asteroids2DShip*>(originator) != nullptr) 123 getGame()->addPoints(100); 122 124 split(); 123 125 //Pawn::damage(damage, healthdamage, shielddamage, originator, cs); 124 if (getGame() && orxonox_cast<Asteroids2DShip*>(originator) != nullptr && getHealth() <= 0)125 getGame()->addPoints(3*42);126 126 } 127 127 -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DWeapon.cc
r11668 r11669 91 91 model->setScale(5); 92 92 93 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 93 //get position and orientation of the ship to know in which direction the projectile needs to fire off 94 Pawn* player = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn(); 94 95 95 projectile->setOrientation( this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getOrientation());96 projectile->setPosition( this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getPosition());96 projectile->setOrientation(player->getOrientation()); 97 projectile->setPosition(player->getPosition()); 97 98 98 // auf 2D Ebene druecken99 Vector3 muzzle2D = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getOrientation()* WorldEntity::FRONT;99 //Velocity & position of the projectile must be y = 0 since the game takes place in the x-z plane 100 Vector3 muzzle2D = player->getOrientation()* WorldEntity::FRONT ; 100 101 muzzle2D.y = 0; 101 102 102 projectile->setVelocity(muzzle2D * this->speed_); 103 103 -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DWeapon.h
r11660 r11669 21 21 * 22 22 * Author: 23 * Florian Zinggeler23 * Viviane Yang 24 24 * Co-authors: 25 25 * ... … … 53 53 54 54 protected: 55 virtual void shot() override; 55 virtual void shot() override; //2D movement 56 56 WeakPtr<Projectile> projectile; 57 57 WeakPtr<Asteroids2D> game;
Note: See TracChangeset
for help on using the changeset viewer.