aboutsummaryrefslogtreecommitdiffstats
path: root/include/world.h
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-11-10 08:38:30 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-11-10 08:38:30 -0500
commita075f1b6c2c65570ab7b249b12efefcfcc442e95 (patch)
tree5d8a933505b31e3da8071f15f30240bb5828d925 /include/world.h
parentb0f7e8d2caa72ab1fe93fa58dbfa841750d96037 (diff)
Added spawn world
Diffstat (limited to 'include/world.h')
-rw-r--r--include/world.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/world.h b/include/world.h
index 9d7a33b..48ca47b 100644
--- a/include/world.h
+++ b/include/world.h
@@ -4,6 +4,11 @@
#include <common.h> // For HLINE, vec2, OpenGL utilities, etc.
#include <entities.h>
+#define GEN_INC 10 // Defines at what interval y values should be calculated for the array 'line'.
+ // As explained in World(), the last few lines in the array 'line' are incorrectly calculated
+ // or not calculated at all, so GEN_INC is also used to decrease 'lineCount' in functions like draw()
+ // and detect().
+
struct line_t {
bool gs;
float y,gh[2];
@@ -95,7 +100,7 @@ public:
*/
virtual void generate(unsigned int width);
- void generateFunc(unsigned int width,unsigned int (*func)(unsigned int));
+ void generateFunc(unsigned int width,float(*func)(float));
/*
* Looks for the furthest back layer in this world and adds a new layer of width `width` behind it.