Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxStones.h @ 12356

Last change on this file since 12356 was 12356, checked in by pomselj, 5 years ago

Bounces ok-ish, still seg fault… stones get destroyed but models stay, maybe destroy wals too

File size: 2.2 KB
Line 
1#ifndef _OrxoBloxStones_H__
2#define _OrxoBloxStones_H__
3
4
5#include "OrxoBlox/OrxoBloxPrereqs.h"
6
7
8#include "worldentities/StaticEntity.h"
9#include "tools/Timer.h"
10
11namespace orxonox
12{
13
14    /**
15    @brief
16
17    @author
18
19    @ingroup OrxoBlox
20    */
21    class _OrxoBloxExport OrxoBloxStones : public StaticEntity
22    {
23        public:
24            OrxoBloxStones(Context* context); //!< Constructor. Registers and initializes the object.
25            virtual ~OrxoBloxStones() {}
26             //   this.destroy();
27            //}
28
29            /**
30            @brief Set the size of the stone.
31            @param size The dimensions a stone has in the game world. (A stone is a cube)
32            */
33            void setSize(float size)
34                { this->size_ = size; }
35            /**
36            @brief Get the size of the stone.
37            @return Returns the dimensions a stone has in the game world. (A stone is a cube)
38            */
39            float getSize(void) const
40                { return this->size_; }
41            /**
42            @brief Set the Health of the stone.
43            @param size The dimensions a stone has in the game world. (A stone is a cube)
44            */
45            void setHealth(unsigned int health)
46                { 
47                    this->health_ = health; 
48                }
49            /**
50            @brief Get the size of the stone.
51            @return Returns the dimensions a stone has in the game world. (A stone is a cube)
52            */
53            unsigned int getHealth(void) const
54                { return this->health_; }
55
56            void gotHit(){
57                if (this->health_ > 0){
58                    this->health_ -= this->health_; 
59                    }
60                //  else ~OrxoBloxStones();
61                }
62
63            void setGame(OrxoBlox* orxoblox)
64                { assert(orxoblox); orxoblox_ = orxoblox; }
65
66            unsigned int getHealth();
67
68            void reduceHealth();
69               
70        private:
71            float size_; //!< The dimensions a stone has in the game world.
72            unsigned int health_;
73            bool delay_;
74           
75            OrxoBlox* orxoblox_;
76           
77
78    };
79}
80
81#endif /* _OrxoBloxStones_H__ */
Note: See TracBrowser for help on using the repository browser.