aboutsummaryrefslogtreecommitdiffstats
path: root/include/world.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/world.h')
-rw-r--r--include/world.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/include/world.h b/include/world.h
index 8aaba0c..083474a 100644
--- a/include/world.h
+++ b/include/world.h
@@ -78,26 +78,38 @@ protected:
int x_start;
/**
- *
+ * Handle physics for a single entity.
+ * This function handles gravity and death for an entity. The public version
+ * of this, World::detect(), handles all entities in the world as well as
+ * the player. World::singleDetect() should never be used outside of
+ * World::detect(), which is why it is declared private.
*/
void singleDetect(Entity *e);
- /*
- * Deletes all entities in the world.
- */
+ /**
+ * Empties all entity vectors.
+ * Each entity vector is iterated through, calling delete for each entry.
+ * Once all specific vectors are cleared, the general entity vector is
+ * emptied of the pointers to those other vectors. This function should only
+ * be called in World's destructor, as there shouldn't be another reason to
+ * call this function.
+ */
void deleteEntities(void);
- /*
- * The size of the line array. This is set once by World->generate().
- */
+ /**
+ * Number of lines in the world.
+ * While this number is helpful for knowing the world's width, it is kept
+ * private for security reasons. To compensate for this,
+ * World::getTheWidth() is provided (see below).
+ */
unsigned int lineCount;
- /*
- * Contains the background image layers (including the background image).
- */
+ /**
+ * An array of star coordinates.
+ */
vec2 *star;