Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2014, 5:16:20 PM (10 years ago)
Author:
richtero
Message:

getting closer to a playable version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameBoard.cc

    r10131 r10156  
    3838
    3939#include "gametypes/Gametype.h"
     40#include "graphics/BlinkingBillboard.h"
    4041
    4142#include "core/XMLPort.h"
     
    5758        //this->registerVariables();
    5859
    59         //initialize sound
     60        //initialize board
    6061        for(int i=0;i<4;i++){
    6162                for(int j=0;j<4;j++){
     
    6768                }
    6869        }
     70
     71        this->checkGametype();
    6972    }
    7073
     
    123126        {
    124127                this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = (mini4DgamePlayerColor::color) playerColor;
    125                 //BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
    126                 //bb->setPosition(0,0,0);
     128                        BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
     129                        orxout(user_status) << "Mini4Dgame: move.x " << move.x << endl;
     130
     131                        bb->setPosition(60*(int)move.x-90,60*(int)move.y-90,60*(int)move.z-90);
     132                        bb->setFrequency(0.6);
     133                        bb->setAmplitude(0.1);
     134                        //bb->setMaterial("Flares/lensflare");
     135                        bb->setMaterial("Numbers/One");
     136                        bb->setColour(ColourValue(0,1,0));
     137
     138                        this->attach(bb);
     139
     140
    127141                Mini4DgameWinner winner = this->getWinner();
    128142                if(winner.color_ != mini4DgamePlayerColor::none)
    129143                {
     144                        orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl;
    130145                        //win(winner);
    131146                }
     
    837852        return winner;
    838853    }
     854
     855    /**
     856    @brief
     857        Is called when the gametype has changed.
     858    */
     859    void Mini4DgameBoard::changedGametype()
     860    {
     861        SUPER(Mini4DgameBoard, changedGametype);
     862
     863        // Check, whether it's still Mini4Dgame.
     864        this->checkGametype();
     865    }
     866
     867    /**
     868    @brief
     869        Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint.
     870    */
     871    void Mini4DgameBoard::checkGametype()
     872    {
     873        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
     874        {
     875            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype().get());
     876            Mini4DgameGametype->setGameboard(this);
     877        }
     878    }
    839879}
Note: See TracChangeset for help on using the changeset viewer.