[Orxonox-commit 4470] r9141 - in code/branches/newlevel2012: data/levels src/modules/towerdefense
mentzerf at orxonox.net
mentzerf at orxonox.net
Sun Apr 29 15:42:22 CEST 2012
Author: mentzerf
Date: 2012-04-29 15:42:22 +0200 (Sun, 29 Apr 2012)
New Revision: 9141
Added:
code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt
Modified:
code/branches/newlevel2012/data/levels/towerDefense.oxw
code/branches/newlevel2012/src/modules/towerdefense/Tower.cc
code/branches/newlevel2012/src/modules/towerdefense/Tower.h
code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h
code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc
code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h
Log:
Added readme file and reformatted some more
Modified: code/branches/newlevel2012/data/levels/towerDefense.oxw
===================================================================
--- code/branches/newlevel2012/data/levels/towerDefense.oxw 2012-04-29 12:05:17 UTC (rev 9140)
+++ code/branches/newlevel2012/data/levels/towerDefense.oxw 2012-04-29 13:42:22 UTC (rev 9141)
@@ -1,4 +1,7 @@
<!-- TODO: Update the level's image-->
+
+<!-- See TowerDefenseReadme.txt for Information on this file -->
+
<LevelInfo
name = "Tower Defense"
description = "Defend your Spacestation from incoming waves."
@@ -17,14 +20,6 @@
include("templates/spaceshipPirate.oxt")
?>
-<!-- Hallo erstmal.
-Ich habe das Grundgerüst des Levels mal zum Laufen gebracht.
-Bei mir hat es das Playfield_ME.mesh allerdings nicht angezeigt; deswegen habe ich mit dem crate.mesh als testobjekt gearbeitet.
-Das Level macht genau das was ihr vermutlich erreichen wolltet. Wahrscheinlich wird die Funktionalität der "statischen Kamera" aber
-bloß in einer abgewandelten Art umgesetzt: In Pong und Tetris sind die Kameras nicht an das Spielfeld, sondern an ein ControllableEntity,
-das vom Spieler gesteuert wird gekoppelt.
--->
-
<!-- Specify the position of the camera -->
<Template name=centerpointmarkcamera defaults=0>
<Pawn>
Modified: code/branches/newlevel2012/src/modules/towerdefense/Tower.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/Tower.cc 2012-04-29 12:05:17 UTC (rev 9140)
+++ code/branches/newlevel2012/src/modules/towerdefense/Tower.cc 2012-04-29 13:42:22 UTC (rev 9141)
@@ -6,6 +6,8 @@
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
+/* Not implemented fully */
+
#include "Tower.h"
#include "core/CoreIncludes.h"
Modified: code/branches/newlevel2012/src/modules/towerdefense/Tower.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/Tower.h 2012-04-29 12:05:17 UTC (rev 9140)
+++ code/branches/newlevel2012/src/modules/towerdefense/Tower.h 2012-04-29 13:42:22 UTC (rev 9141)
@@ -6,6 +6,14 @@
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
+/**
+ at brief
+See TowerDefenseReadme.txt for Information.
+
+ at ingroup TowerDefense
+*/
+
+
#ifndef Orxonox_Tower_h
#define Orxonox_Tower_h
@@ -20,8 +28,8 @@
Tower(BaseObject* creator);
virtual ~Tower() {};
- virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
- virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+ virtual void moveFrontBack(const Vector2& value);
+ virtual void moveRightLeft(const Vector2& value);
void setGame(TowerDefense* towerdefense)
{ assert(towerdefense); game_ = towerdefense; }
Modified: code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h 2012-04-29 12:05:17 UTC (rev 9140)
+++ code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h 2012-04-29 13:42:22 UTC (rev 9141)
@@ -25,6 +25,14 @@
* ...
*
*/
+
+ /**
+ @brief
+ GameType class for TowerDefense. See TowerDefenseReadme.txt for Information.
+
+ @ingroup TowerDefense
+ */
+
#ifndef _TowerDefense_H__
#define _TowerDefense_H__
Modified: code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2012-04-29 12:05:17 UTC (rev 9140)
+++ code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2012-04-29 13:42:22 UTC (rev 9141)
@@ -49,14 +49,12 @@
TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : StaticEntity(creator)
{
RegisterObject(TowerDefenseCenterpoint);
-
-
-
- this->width_ = 10;
- this->height_ = 11;
+
+ this->width_ = 15;
+ this->height_ = 15;
this->towerTemplate_ = "";
- this->checkGametype();
+ this->checkGametype();
}
/**
@@ -67,8 +65,8 @@
{
SUPER(TowerDefenseCenterpoint, XMLPort, xmlelement, mode);
- XMLPortParam(TowerDefenseCenterpoint, "width", setWidth, getWidth, xmlelement, mode); // die Breite
- XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, setWidth, xmlelement, mode); // die Grösse
+ XMLPortParam(TowerDefenseCenterpoint, "width", setWidth, getWidth, xmlelement, mode);
+ XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, setWidth, xmlelement, mode);
XMLPortParam(TowerDefenseCenterpoint, "towerTemplate", setTowerTemplate, getTowerTemplate, xmlelement, mode);
}
Modified: code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h 2012-04-29 12:05:17 UTC (rev 9140)
+++ code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h 2012-04-29 13:42:22 UTC (rev 9141)
@@ -27,67 +27,46 @@
*/
/**
- @file TowerDefenseCenterpoint.h
- @brief Declaration of the TowerDefenseCenterpoint class.
- @ingroup TowerDefense
-*/
+ @brief
+ See TowerDefenseReadme.txt for Information.
+ @ingroup TowerDefense
+ */
+
#ifndef _TowerDefenseCenterpoint_H__
#define _TowerDefenseCenterpoint_H__
#include "towerdefense/TowerDefensePrereqs.h"
#include <string>
-
#include <util/Math.h>
#include "worldentities/StaticEntity.h"
namespace orxonox
{
-
- /**
- @brief
-
-
- @author
-
- @ingroup TowerDefense
- */
class _TowerDefenseExport TowerDefenseCenterpoint : public StaticEntity
{
public:
- TowerDefenseCenterpoint(BaseObject* creator); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense.
+ TowerDefenseCenterpoint(BaseObject* creator);
virtual ~TowerDefenseCenterpoint() {}
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a TowerDefenseCenterpoint through XML.
-
- virtual void changedGametype(); //!< Is called when the gametype has changed.
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedGametype();
/**
- @brief Set the width of the playing field.
- @param width The width in number of tiles.
+ @brief The width and hight in number of tiles. Default is 15 for both.
*/
void setWidth(unsigned int width)
{ this->width_ = width; }
- /**
- @brief Get the width of the playing field.
- @return Returns the width in number of tiles.
- */
- unsigned int getWidth(void) const
+
+ unsigned int getWidth(void) const
{ return this->width_; }
- /**
- @brief Set the height of the playing field.
- @param height The height in number of tiles.
- */
void setHeight(unsigned int height)
{ this->height_ = height; }
- /**
- @brief Get the height of the playing field.
- @return Returns the height in number of tiles.
- */
- unsigned int getHeight(void) const
+
+ unsigned int getHeight(void) const
{ return this->height_; }
/**
@@ -96,21 +75,16 @@
*/
void setTowerTemplate(const std::string& templateName)
{ this->towerTemplate_ = templateName; }
- /**
- @brief Get the template for the towers.
- @return Returns the template name to be applied to each tower.
- */
- const std::string& getTowerTemplate(void) const
- { return this->towerTemplate_; }
+ const std::string& getTowerTemplate(void) const
+ { return this->towerTemplate_; }
private:
- void checkGametype(); //!< Checks whether the gametype is TowerDefense and if it is, sets its centerpoint.
+ void checkGametype();
unsigned int width_;
unsigned int height_;
std::string towerTemplate_;
-
};
}
Added: code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt (rev 0)
+++ code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt 2012-04-29 13:42:22 UTC (rev 9141)
@@ -0,0 +1,20 @@
+===============================================================================
+Classes
+===============================================================================
+
+TowerDefense:
+GameType class
+
+TowerDefenseCenterpoint
+Centerpoint class. Store tower template
+
+Tower
+Represents a Tower
+
+
+===============================================================================
+Other files
+===============================================================================
+
+/data/levels/towerdefense.oxw
+Loads the level. In <Level>, we first create a SpawnPoint. It spawns a cylinder using the 'centerpointmark' Template, which uses the 'centerpointmarkcamera' Template to create a static camera. Then, we create an instance of TowerDefenseCenterpoint and pass the 'towertemplate' Template, so that we can later create towers using this template. We also plase the playfield.mesh in a way that maps every field on the playfield.mesh to nice coordinates: the playfield spans as a square from -8,-8 to 8,8.
\ No newline at end of file
More information about the Orxonox-commit
mailing list