Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 15, 2018, 10:23:48 PM (6 years ago)
Author:
stadlero
Message:

Province is now a pawn

Location:
code/branches/wagnis_HS18
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/data/levels/Wagnis.oxw

    r12077 r12107  
    1010  include("HUDTemplates3.oxo")
    1111  include("templates/lodInformation.oxt")
     12  include("templates/spaceshipAssff.oxt")
     13  include("templates/spaceshipGhost.oxt")
     14  include("templates/spaceshipSpacecruiser.oxt")
    1215?>
    1316
     
    4649
    4750    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
    48     <SpawnPoint position="100, 45, 75" lookat="0, 45, 75" />
     51
     52    <SpawnPoint
     53    position="100, 45, 75"
     54    lookat="0, 45, 75"
     55    spawnclass=SpaceShip
     56    pawndesign=spaceshipAssff
     57    />
    4958
    5059<WagnisGameboard position="0,0,0" connections_string="1=2+1000, 2=1, 1000=1">
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc

    r12102 r12107  
    55#include <vector>
    66
     7#define WAGNIS_PROVINCE_MAX_HEALTH 1000.0f
     8
     9/**TODO
     10 *
     11 *
     12 *
     13 **/
     14
    715namespace orxonox
    816{
     
    1018
    1119    //Constructor
    12     WagnisProvince::WagnisProvince(Context* context) : MovableEntity(context){
     20    WagnisProvince::WagnisProvince(Context* context) : Pawn(context){
    1321        RegisterObject(WagnisProvince);
    1422        this->owner_ID = 0;
     
    1826        this->neighbors = std::vector<WagnisProvince*>();
    1927        this->markerBillboard = nullptr;
     28        this->maxHealth_ = WAGNIS_PROVINCE_MAX_HEALTH;
     29        this->health_ = WAGNIS_PROVINCE_MAX_HEALTH-10.0f; // <-- DEBUG
    2030    }
    2131    //Destructor
    2232    WagnisProvince::~WagnisProvince(){
    2333
     34    }
     35
     36    //Tick
     37    void WagnisProvince::tick(float dt){
     38        SUPER(WagnisProvince, tick, dt);
     39
     40        if(this->health_ < this->maxHealth_){
     41            this->health_ = this->maxHealth_;
     42            orxout() << "Health test ok" << endl;        }
    2443    }
    2544
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h

    r12104 r12107  
    1010#include "core/CoreIncludes.h"
    1111#include "core/XMLPort.h"
    12 #include "worldentities/MovableEntity.h"
     12#include "worldentities/pawns/Pawn.h"
    1313#include "graphics/Billboard.h"
    1414#include <vector>
     
    1717namespace orxonox
    1818{
    19     class _WagnisExport WagnisProvince : public MovableEntity
     19    class _WagnisExport WagnisProvince : public Pawn
    2020    {
    2121    public:
    2222        WagnisProvince(Context*);
    2323        virtual ~WagnisProvince();
     24        void tick(float);
     25
     26
    2427        virtual void XMLPort(Element&,XMLPort::Mode);
    2528        void addMarkerBillboard(Billboard*);
     
    3841        void addNeighbor(WagnisProvince*);
    3942        std::vector<WagnisProvince*> neighbors;
     43
    4044 
    4145        int owner_ID;
Note: See TracChangeset for help on using the changeset viewer.