Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 27, 2017, 3:08:16 PM (7 years ago)
Author:
jkindle
Message:

Added a HUD and type to QBlocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBQBlock.cc

    r11400 r11405  
    3535
    3636#include "core/CoreIncludes.h"
     37#include "core/XMLPort.h"
     38#include "SOB.h"
     39#include "SOBMushroom.h"
    3740
    3841namespace orxonox
     
    6265        if (!used_ && v_z > 50.0) {
    6366            used_ = true;
    64         orxout() << "WDestrozed the block" << v_z << endl;
    6567
    66           for (WorldEntity* object : this->getAttachedObjects())
    67             {
    68                
    69                    
    70                 object->setVisible(!object->isVisible());   
     68            for (WorldEntity* object : this->getAttachedObjects())
     69                object->setVisible(!object->isVisible());           
     70
     71            SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
     72            if (type_ == "Coin") {
     73                SOBGame->addCoin();
    7174            }
    72 
    73 
     75            if (type_ == "Mushroom") {
     76                spawnMushroom();
     77            }
    7478
    7579        }
     
    7882
    7983
     84    void SOBQBlock::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     85    {
     86        SUPER(SOBQBlock, XMLPort, xmlelement, mode);
     87        XMLPortParam(SOBQBlock, "type",     setType,     getType,     xmlelement, mode).defaultValues(false);
     88
     89
     90     }
     91
     92
     93     void SOBQBlock::spawnMushroom() {
     94        SOBCenterpoint* center_ = ((SOB*)getGametype())->center_;
     95
     96         SOBMushroom* mush = new SOBMushroom(center_->getContext());
     97         Vector3 spawnpos = this->getWorldPosition();
     98         spawnpos.z += 0;
     99
     100        if (mush != nullptr && center_ != nullptr)
     101        {
     102            mush->addTemplate("mushroom");
     103           
     104
     105
     106            //newBoots->addTemplate(center_->getBootsTemplate());
     107            mush->setPosition(spawnpos);
     108            //newBoots->setProperties(leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity);
     109            //newBoots->setFigure(figure_);
     110            //center_->attach(newBoots);
     111        }
     112     }
     113
     114
    80115}
Note: See TracChangeset for help on using the changeset viewer.