Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2017, 11:32:26 AM (7 years ago)
Author:
vyang
Message:

Kommentare

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  
    3535    TODO:
    3636        - 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.
    3938        - Problem: The asteroids spawn randomly on the playing field.
    4039            During spawn or level up, there is the possibility that they pawn at the position of the ship.
    4140            ->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
    4250
    4351*/
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h

    r11668 r11669  
    3535     - spawns stones in every level up
    3636     - if you shoot and hit a stone, it will spit into two smaller stones
    37      -
    3837    @ingroup Asteroids2D
    3938*/
     
    5655#include "gamestates/GSLevel.h"
    5756#include "chat/ChatManager.h"
    58 #include <vector>
    5957
    6058// ! HACK
     
    109107            int multiplier;
    110108
     109
    111110       private:
    112111
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.cc

    r11660 r11669  
    5151        this->height_ = 646;
    5252    }
     53
     54   
    5355    /**
    5456    @brief
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc

    r11645 r11669  
    2121 *
    2222 *   Author:
    23  *      Florian Zinggeler
     23 *      Viviane Yang
    2424 *
    2525 */
     
    4141
    4242        this->Asteroids2DGame = nullptr;
    43         //this->Ship = nullptr;
    4443        this->bShowPoints_ = true;
    45         this->bShowHealth_ = true;
    4644    }
    4745
     
    7775        }
    7876
    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             else
    90             {
    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         }*/
    9777    }
    9878
     
    10181        SUPER(Asteroids2DHUDinfo, changedOwner);
    10282
    103         if (this->getOwner() && this->getOwner()->getGametype())//&& this->getOwner->getPlayer())
     83        if (this->getOwner() && this->getOwner()->getGametype())
    10484        {
    10585            this->Asteroids2DGame = orxonox_cast<Asteroids2D*>(this->getOwner()->getGametype());
    106             //this->Ship = orxonox_cast<Asteroids2DShip*>(this->getOwner()->getPlayer());
     86
    10787        }
    10888        else
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h

    r11645 r11669  
    2121 *
    2222 *   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 
    2427 *
    2528 */
     
    5356                { return this->bShowPoints_; }
    5457
    55             inline void setShowHealth(bool value)
    56                 { this->bShowHealth_ = value; }
    57             inline bool getShowHealth() const
    58                 { return this->bShowHealth_; }
    59 
    6058
    6159        private:
     
    6462            bool bShowLevel_;
    6563            bool bShowPoints_;
    66             bool bShowHealth_;
     64
    6765
    6866    };
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DPrereqs.h

    r11593 r11669  
    2121 *
    2222 *   Author:
    23  *      Florian Zinggeler
     23 *      Viviane Yang
    2424 *   Co-authors:
    2525 *      ...
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DStone.cc

    r11668 r11669  
    120120    void Asteroids2DStone::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    121121    {
     122        if (getGame() && orxonox_cast<Asteroids2DShip*>(originator) != nullptr)
     123            getGame()->addPoints(100);
    122124        split();
    123125        //Pawn::damage(damage, healthdamage, shielddamage, originator, cs);
    124         if (getGame() && orxonox_cast<Asteroids2DShip*>(originator) != nullptr && getHealth() <= 0)
    125             getGame()->addPoints(3*42);
    126126    }
    127127
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DWeapon.cc

    r11668 r11669  
    9191        model->setScale(5);
    9292
    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();
    9495
    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());
    9798
    98         //auf 2D Ebene druecken
    99         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 ;
    100101        muzzle2D.y = 0;
    101 
    102102        projectile->setVelocity(muzzle2D * this->speed_);
    103103
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DWeapon.h

    r11660 r11669  
    2121 *
    2222 *   Author:
    23  *      Florian Zinggeler
     23 *      Viviane Yang
    2424 *   Co-authors:
    2525 *      ...
     
    5353
    5454        protected:
    55             virtual void shot() override;
     55            virtual void shot() override; //2D movement
    5656            WeakPtr<Projectile> projectile;
    5757            WeakPtr<Asteroids2D> game;
Note: See TracChangeset for help on using the changeset viewer.