diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-03-21 08:49:48 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-03-21 08:49:48 -0400 |
commit | afdbe5de31c9ae1009d36710eb2b1c31ec44a9f5 (patch) | |
tree | 58812c528ea6d4995a6acad83a156c6fd5bd0407 /main.cpp | |
parent | 3432a970912dac94d9ba527f10f0354dcc396bf4 (diff) | |
parent | 51c6e601c3d6451294506b72213244e3aee9822f (diff) |
cleaning up ui code
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -417,7 +417,6 @@ int main(int argc, char *argv[]){ //currentWorld->mob.back()->followee = player; gameRunning = true; - while ( gameRunning ) mainLoop(); @@ -494,6 +493,13 @@ void mainLoop(void){ prevPrevTime = currentTime; } + /* + * Update player and entity coordinates. + */ + + /*pool.Enqueue([](){ + currentWorld->update(player,deltaTime); + });*/ currentWorld->update( player, deltaTime ); /* @@ -772,9 +778,9 @@ void logic(){ if(n->canMove) n->wander((rand() % 120 + 30)); - /*if(!player->inv->usingi) n->hit = false; + if(!player->inv->usingi) n->hit = false; - if(player->inv->usingi && !n->hit && player->inv->detectCollision((vec2){n->loc.x, n->loc.y},(vec2){n->loc.x+n->width,n->loc.y+n->height})){ + if(player->inv->usingi && !n->hit && player->inv->detectCollision({n->loc.x, n->loc.y},{n->loc.x+n->width,n->loc.y+n->height})){ n->health -= 25; n->hit = true; for(int r = 0; r < (rand()%5);r++) @@ -783,8 +789,7 @@ void logic(){ for(int r = 0; r < (rand()%30)+15;r++) currentWorld->addParticle(rand()%HLINE*3 + n->loc.x - .05f,n->loc.y + n->height*.5, HLINE,HLINE, -(rand()%10)*.01,((rand()%10)*.01-.05), {(rand()%75)+10/100.0f,0,0}, 10000); } - }*/ - + } /* * Don't bother handling the NPC if another has already been handled. */ |