Orxonox  0.0.5 Codename: Arcturus
Asteroids2DStone.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Viviane Yang
24  * Co-authors:
25  * ...
26  * TO DO:
27  *
28  */
29 
36 #ifndef _Asteroids2DStone_H__
37 #define _Asteroids2DStone_H__
38 
40 
42 
43 
44 namespace orxonox
45 {
47  {
48  public:
49  Asteroids2DStone(Context* context);
50  Asteroids2DStone(Context* c, int sze, Vector3 pos);
51 
52  virtual void tick(float dt) override;
53  Vector3 randomPosition (float maxwidth, float maxheight);
54  Vector3 randomVelocity(float maxspeed);
55  virtual int getSize(){ return this->size;}
56  virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
57  virtual void split();
58  virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override;
59 
60  private:
61  Asteroids2D* getGame();
63  int size; // three sizes, 3-> two 2s, 2-> two 1s, 1-> die
64  float width, height; //field
65  float MAX_SPEED = 100;
66  float delta = 5;
67  };
68 }
69 
70 #endif /* _Asteroids2DStone_H__ */
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
Definition: Asteroids2D.h:51
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
The WorldEntity represents everything that can be put in a Scene at a certain location.
Definition: WorldEntity.h:72
virtual int getSize()
Definition: Asteroids2DStone.h:55
float width
Definition: Asteroids2DStone.h:64
Shared library macros, enums, constants and forward declarations for the Asteroids2D module ...
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _Asteroids2DExport
Definition: Asteroids2DPrereqs.h:60
int size
Definition: Asteroids2DStone.h:63
Definition: Context.h:45
WeakPtr< Asteroids2D > game
Definition: Asteroids2DStone.h:62
Definition: Asteroids2DStone.h:46