From: Clyne Sullivan Date: Mon, 14 Sep 2015 21:40:59 +0000 (-0400) Subject: cheap-excuse jump fix X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=b04891e13dcb33ee8ea26470deae440d0c664420;p=clyne%2Fgamedev.git cheap-excuse jump fix --- diff --git a/src/World.cpp b/src/World.cpp index 41649d9..bde35de 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -104,6 +104,7 @@ LOOP2: // Should be in furthest back layer once this is first rea } } } +extern World *spawn; void World::detect(vec2 *v,vec2 *vel,const float width){ unsigned int i; for(i=0;iy>line[i].start+HLINE){ // Trashy gravity handling - vel->y-=.0000001; + vel->y-=this==spawn?.0000001:.0000003; } } } diff --git a/src/main.cpp b/src/main.cpp index 4d48d81..f3e95ee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,8 @@ Structures build; UIClass ui; //Yep World *currentWorld;//u-huh +World *spawn; + void logic(); void render(); @@ -89,7 +91,7 @@ int main(int argc,char **argv){ w2=new World(4,w,NULL); w=new World(10,NULL,w2); - currentWorld=w; + spawn=currentWorld=w; currentWorld->addLayer(3); currentWorld->addLayer(4); // shh