diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-10 16:16:39 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-10 16:16:39 -0400 |
commit | a103b556146e434d038487fe518b854da8bc10d3 (patch) | |
tree | 5c66f2c1113aadb48ea8939c696f7d2410df9b8f /src | |
parent | 01796ef04688e10cfbc4c3aa63999f7dfabeb64e (diff) |
more better
Diffstat (limited to 'src')
-rw-r--r-- | src/World.cpp | 7 | ||||
-rw-r--r-- | src/main.cpp | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp index 24f836f..cf14612 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -62,6 +62,7 @@ void World::draw(void){ }
glEnd();
}
+#include <stdio.h>
void World::detect(vec2 *v,const float width){
unsigned int i;
for(i=0;i<lineCount;i++){
@@ -71,10 +72,10 @@ void World::detect(vec2 *v,const float width){ }else if(v->x+width>(HLINE*i)-1&&v->x+width<(HLINE*i)-1+HLINE){
v->x=(HLINE*i)-1-width;
}else{
- v->y=line[i].start;
+ v->y=line[i].start+HLINE/4;
}
- }else if(v->y>line[i].start+HLINE/2){
- v->y-=HLINE/4;
+ }else if(v->y>line[i].start+HLINE/4){
+ //v->y-=HLINE/8;
}
}
}
diff --git a/src/main.cpp b/src/main.cpp index 3d1afb6..c404f22 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -159,6 +159,7 @@ unsigned int logic(unsigned int interval,void *param){ ui.handleEvents(); // Handle events player.vel.x = 0; + currentWorld->detect(&player.loci,player.width); //std::cout << player.vel.x << std::endl; //std::cout << player.velg.y << std::endl; |