Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 11, 2017, 3:18:27 PM (7 years ago)
Author:
jkindle
Message:

Added the animation for the level end (walk into castle), Coins for the blocks, Castleblocks and Flagblocks

File:
1 edited

Legend:

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

    r11412 r11416  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Julien Kindle
    2424 *   Co-authors:
    25  *      ...
     25 *     
    2626 *
    2727 */
    2828
    2929/**
    30     @file Pong.cc
    31     @brief Implementation of the Pong class.
     30    @file SOB.cc
     31    @brief Implementation of the SOB class.
    3232*/
    3333
    3434#include "SOB.h"
    35 
    3635#include "core/CoreIncludes.h"
    3736#include "core/EventIncludes.h"
     
    3938#include "core/config/ConfigValueIncludes.h"
    4039#include "core/Game.h"
    41 
    4240#include "gamestates/GSLevel.h"
    4341#include "chat/ChatManager.h"
    4442#include "infos/PlayerInfo.h"
    45 
    4643#include "SOBCenterpoint.h"
    47 
    4844#include "SOBFigure.h"
    4945#include "graphics/Camera.h"
     46
     47
    5048
    5149namespace orxonox
     
    8987    }
    9088
     89
     90
    9191    void SOB::start()
    9292    {
     
    9595            if (figure_ == nullptr)
    9696            {
    97                 figure_ = new SOBFigure(center_->getContext());
     97                figure_ = new SOBFigure(center_->getContext());     //add a new instance of a player to the game
    9898                figure_->addTemplate(center_->getFigureTemplate());
    99                // figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    10099            }
    101100
     
    124123        cleanup();
    125124        GSLevel::startMainMenu();
    126 
    127125        Deathmatch::end();
    128126    }
     
    131129        cleanup();
    132130
    133         // HACK
     131        // HACK - only method I found to simply reload the level
    134132        Game::getInstance().popState();
    135133        Game::getInstance().popState();
     
    144142        if (figure_->getPlayer() == nullptr)
    145143        {
    146             player->startControl(figure_);
     144            player->startControl(figure_); //Give the control of the instance player to the real person
    147145            players_[player].state_ = PlayerState::Alive;
    148146        }
     
    165163        SUPER(SOB, tick, dt);
    166164
    167         if (this->figure_ != nullptr && figure_->dead_) {
     165        //If player has reached end of level
     166        if (this->figure_ != nullptr && figure_->lvlEnded_) {
     167            std::stringstream a;
     168            a << "Nice! " << getPoints() << " Points. Press <Space> to restart";
     169            info_ =a.str();
     170
     171        //If player has died
     172        } else if (this->figure_ != nullptr && figure_->dead_) {
    168173            info_ = "Game over. Press <Space> to restart";
    169             orxout() << "DEED" << endl;
    170174        }
    171175       
    172176
     177        //Kill the player if time is up
     178        if (this->figure_ != nullptr && timeLeft_ <= 0)
     179            this->figure_->dead_ = true;
     180        //The time on the HUD
    173181        timeLeft_-=dt*2.5;
    174182    }
Note: See TracChangeset for help on using the changeset viewer.