Changeset 11668
- Timestamp:
- Dec 13, 2017, 9:21:25 AM (7 years ago)
- Location:
- code/branches/Asteroid_HS17
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt
r11645 r11668 7 7 explosionchunks = 4 8 8 9 health = 10 0010 maxhealth = 10 0011 initialhealth = 10 009 health = 10 10 maxhealth = 10 11 initialhealth = 10 12 12 13 13 shieldhealth = 20 -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc
r11660 r11668 36 36 - Implement a counting system for the score 37 37 - HUD can be improved (display health, points, level etc.) 38 - Projectiles still 38 - Projectiles still fly in a mysterious direction 39 - Problem: The asteroids spawn randomly on the playing field. 40 During spawn or level up, there is the possibility that they pawn at the position of the ship. 41 ->spawn somewhere with a safty distance/radius 42 39 43 */ 40 44 … … 54 58 55 59 bEndGame = false; 56 lives = 1000;60 lives = 3; 57 61 level = 1; 58 62 point = 0; … … 75 79 { 76 80 77 // kann schoener gemacht werden81 //Do something that indicates a level up 78 82 for (int i = 0; i < 7; i++) 79 83 { … … 94 98 95 99 96 //After level up -> spawn stones 100 //After level up -> spawn stones. Modify for different difficulty level 97 101 for(int i = 0; i < level*2; i++){ 98 102 spawnStone(); … … 111 115 spawnStone(); 112 116 } 113 117 //after first tick, firstTick_ will remain false 114 118 this->firstTick_ = false; 115 119 } … … 121 125 { 122 126 123 //stones are created with a size 127 //stones are created with a size -> second constructor in Asteroids2DStone class 124 128 Asteroids2DStone* newStone = new Asteroids2DStone(this->center_->getContext()); 125 129 newStone->setAsteroids2DPlayer(player); 126 130 131 //look at templates in data/levels/templates/asteroidsAsteroids2D.oxt 127 132 switch(newStone->getSize()){ 128 133 case 1: … … 165 170 void Asteroids2D::start() 166 171 { 167 orxout() << "start" << endl;172 //orxout() << "start" << endl; 168 173 169 174 // Set variable to temporarily force the player to spawn. … … 188 193 } 189 194 190 // wird gerufen, falls man einen Asteroiden trifft->Aufruf durch Schiffklasse195 //This function will be called from the ship or the stone class (if the stone was hit) 191 196 void Asteroids2D::addPoints(int numPoints) 192 197 { -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h
r11660 r11668 77 77 virtual void end() override; 78 78 79 //updates the game every few ns 79 80 virtual void tick(float dt) override; 80 81 … … 99 100 // checks if multiplier should be reset. 100 101 void costLife(); 102 103 //Returns player (ship) of the game 101 104 Asteroids2DShip* getPlayer(); 102 105 -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc
r11666 r11668 29 29 /* TODO: 30 30 31 /**32 31 @file Asteroids2DShip.cc 33 32 @brief Implementation of the Asteroids2DShip class. … … 46 45 RegisterObject(Asteroids2DShip); 47 46 48 speed = 830;49 47 isFireing = false; 50 damping = 10;51 48 this->width = 1043; 52 49 this->height = 646; -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
r11660 r11668 63 63 virtual void rotatePitch(const Vector2& value) override{}; // Rotate in pitch direction. 64 64 virtual void rotateRoll(const Vector2& value) override{}; // Rotate in roll direction. 65 virtual void boost(bool boost) override; 65 virtual void boost(bool boost) override; //Override, so that the ship does not shake 66 66 virtual void updateLevel(); 67 67 68 68 virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 69 69 70 float speed, damping;71 70 bool isFireing; 71 72 /*Functions that can be helpful while debugging. 73 - Set a timer so that the function is called for instance every 3s to display the coordinates 74 - Open console with "~`"-key in when you start the Asteroids2D - Minigame. 75 */ 72 76 void showposition(); 73 77 void showorientation(); 78 79 74 80 void toggleImmune() 75 81 { -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DStone.cc
r11666 r11668 111 111 inline bool Asteroids2DStone::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 112 112 { 113 orxout() << "AsteroidStone getroffen" << endl;114 113 if(orxonox_cast<Asteroids2DShip*>(otherObject)) 115 114 { 116 orxout() << "getroffen von Ship" << endl;117 115 split(); 118 116 } … … 140 138 void Asteroids2DStone::split() 141 139 { 142 orxout() << "split" << endl;140 //orxout() << "split" << endl; 143 141 if(size == 3) 144 142 { -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DWeapon.cc
r11660 r11668 93 93 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 94 94 95 //projectile->setOrientation(this->getGame()->getPlayer()->getOrientation()); 96 projectile->setPosition(this->getMuzzlePosition()); 97 95 projectile->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getOrientation()); 96 projectile->setPosition(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getPosition()); 98 97 99 98 //auf 2D Ebene druecken 100 Vector3 muzzle2D = this->get MuzzleDirection();99 Vector3 muzzle2D = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getOrientation()* WorldEntity::FRONT; 101 100 muzzle2D.y = 0; 102 101
Note: See TracChangeset
for help on using the changeset viewer.