aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-03-21 08:49:48 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-03-21 08:49:48 -0400
commitafdbe5de31c9ae1009d36710eb2b1c31ec44a9f5 (patch)
tree58812c528ea6d4995a6acad83a156c6fd5bd0407 /main.cpp
parent3432a970912dac94d9ba527f10f0354dcc396bf4 (diff)
parent51c6e601c3d6451294506b72213244e3aee9822f (diff)
cleaning up ui code
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index acbc4f6..0b3984e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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.
*/