Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2017, 3:29:03 PM (7 years ago)
Author:
merholzl
Message:

XML Ports and cleanUp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc

    r11598 r11600  
    3737#include "core/command/Executor.h"
    3838#include "core/config/ConfigValueIncludes.h"
    39 
     39#include "core/XMLPort.h"
    4040#include "gamestates/GSLevel.h"
    4141#include "chat/ChatManager.h"
     
    6363        bIsDead = true;
    6464        firstGame = true;                   //needed for the HUD
    65 
    66         spawnDistance=200;                  //distance between tubes
     65        speed = 0;
     66        spawnDistance=300;                  //distance between tubes
    6767        tubeOffsetX=500;                    //tube offset (so that we can't see them spawn)
    6868
     
    7070        setHUDTemplate("FlappyOrxHUD");
    7171    }
    72 
     72   
     73    void FlappyOrx::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     74        {   
     75            SUPER(FlappyOrx, XMLPort, xmlelement, mode);
     76            XMLPortParam(FlappyOrx, "spawnDistance", setspawnDistance, getspawnDistance, xmlelement, mode);
     77            XMLPortParam(FlappyOrx, "Speed", setSpeed, getSpeed, xmlelement, mode);
     78        }
    7379
    7480    void FlappyOrx::updatePlayerPos(int x){
     
    95101    void FlappyOrx::levelUp(){
    96102        point++;
    97         spawnDistance = 300-3*point;            //smaller spawn Distance
    98         getPlayer()->setSpeed(100+.5*point);    //increase speed
     103        spawnDistance = spawnDistance-3*point;            //smaller spawn Distance
     104        getPlayer()->setSpeed(this->speed+.5*point);    //increase speed
    99105    }
    100106
Note: See TracChangeset for help on using the changeset viewer.