diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-12-14 08:43:28 -0500 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-12-14 08:43:28 -0500 |
commit | 840cf5f0d3fc60aceb95385010eac02ae6c95dcc (patch) | |
tree | 0b7eb237737289ad9b3f9bffc1478875d0d71abf /src/world.cpp | |
parent | 3f70fa248e411178f33075f4b90f112eced37f14 (diff) | |
parent | 477e6cdde57a428b41e814943233d8b01f0db6bf (diff) |
Merge branch 'master' of http://github.com/tcsullivan/gamedev
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/world.cpp b/src/world.cpp index c1c306e..6909cf7 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -380,7 +380,7 @@ LLLOOP: current=current->infront; goto LLLOOP; } - cx_start = current->x_start; + cx_start = current->x_start * 1.5; width = (-x_start) << 1; glEnable(GL_TEXTURE_2D); @@ -466,6 +466,9 @@ LLLOOP: glDisable(GL_TEXTURE_2D); + glColor3ub(0,0,0); + glRectf(cx_start,GEN_MIN,-cx_start,0); + /* * World drawing is done recursively, meaning that this function jumps * back as many 'layers' as it can and then draws, eventually coming @@ -1005,6 +1008,14 @@ World *World::goWorldFront(Player *p){ return this; } +bool World::isWorldLeft(void){ + return toLeft ? true : false; +} + +bool World::isWorldRight(void){ + return toRight ? true : false; +} + std::vector<void *>thing; World *World::goInsideStructure(Player *p){ if(!thing.size()){ @@ -1142,18 +1153,13 @@ extern bool inBattle; Arena::Arena(World *leave,Player *p){ generate(300); - //door.y = line[299].y; - //door.x = 100; - exit = leave; - - /*npc.push_back(new NPC()); - entity.push_back(npc.back()); - entity.back()->spawn(door.x,door.y); - entity.back()->width = HLINE * 12; - entity.back()->height = HLINE * 16;*/ - + addMob(MS_DOOR,100,100); inBattle = true; + exit = leave; pxy = p->loc; + + star = new vec2[100]; + memset(star,0,100 * sizeof(vec2)); } Arena::~Arena(void){ @@ -1165,11 +1171,11 @@ Arena::~Arena(void){ } World *Arena::exitArena(Player *p){ - npc[0]->loc.x = door.x; - npc[0]->loc.y = door.y; - if(p->loc.x + p->width / 2 > door.x && - p->loc.x + p->width / 2 < door.x + HLINE * 12 ){ + if(p->loc.x + p->width / 2 > mob[0]->loc.x && + p->loc.x + p->width / 2 < mob[0]->loc.x + HLINE * 12 ){ inBattle = false; + ui::toggleBlackFast(); + ui::waitForCover(); p->loc = pxy; return exit; }else{ |