diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-12 20:55:37 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-12 20:55:37 -0400 |
commit | f3028d986781fb9a5199b6a0394b5a79871af156 (patch) | |
tree | 4adb1a0e97d5095c4087ebf9df25e592dc406421 /src/main.cpp | |
parent | 16b3df909a66c9a70309e878f67a962230b799ed (diff) |
jump
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 50eab25..a9e5179 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -103,6 +103,9 @@ int main(int argc,char **argv){ } player.loc.x += player.vel.x*deltaTime; //update the player's x based on + player.loc.y += player.vel.y*deltaTime; + + npc.loc.y += npc.vel.y*deltaTime; gw=currentWorld->getWidth(); if(player.loc.x+player.width>-1+gw){ @@ -192,8 +195,8 @@ void logic(){ std::cout<<"\r("<<player.loc.x<<","<<player.loc.y<<")"; - currentWorld->detect(&player.loc,player.width); - currentWorld->detect(&npc.loc,npc.height); + currentWorld->detect(&player.loc,&player.vel,player.width); + currentWorld->detect(&npc.loc,&player.vel,npc.height); tickCount++; } |