- continued to document header files through doxygen
- added border to dialogBox
- fix entity movement handling; npcs stop when you talk to them
-<<<<<<< HEAD
- - added sword animation?
-=======
- added sword animation?
12/9/2015,
- imrpoved BGM handling
- continued work on particles, made a fountain
- added sanic
-=======
~ Broke 5000 lines of code/doc, now with some file Doxygen'd
- fixed fading bugs
- continued fixing general game bugs
- fixed structure spawn issues
-=======
12/15/2015:
===========
- xml'd npc dialogs
- drafted page xml
-1/11/2015:
+1/11/2016:
==========
- improved npc dialog xmling
- textures?
- music?
-1/12/2015:
+1/12/2016:
==========
- world linking xml'd
- shaderssss
- more music
-1/13/2015:
+1/13/2016:
==========
- discovered how intel and nvidia gpus handle lighting
- xml'd settings for screen dimensions
- xml'd item giving through npc dialog
-1/14/2015:
+1/14/2016:
==========
- pondered on non-random generation
- began to incorporate XML into the world class for dynamic world loading...
-1/16/2015:
+1/16/2016:
==========
- removed layers
- switched world linking from pointers to file names, rewrote all world-linking code
- worlds are now loaded dynamically
-1/19/2015:
+1/19/2016:
==========
- memory management
- began reconsidering save/load stuff
-1/20/2015:
+1/20/2016:
==========
- can save npc dialog positions
- worked on player sprite redesign
- greatly simplified/documented gameplay.cpp
+
+1/21/2016:
+==========
+
+ - can save most mob positions
+ - fixed world widths, background drawing
+ - added aggressive flag to mobs, player enters arena on impact
+ - added world load fault handlers
+ - worked on player sprite redesign
+
+ ~ A little over 5200 lines of code
+mAndreas
mByron
mClark
mJarrett
-mJohnny
mHarrison
mFrederick
mPercy
mBroderick
mAshley
mMauro
-mDaren
+mDarien
mRigoberto
mChuck
mAndy
fMonserrate
fAnn
fAshley
-fAbby Ross
\ No newline at end of file
+fAbby Ross
class Mob : public Entity{
public:
+ bool aggressive;
double init_y;
void (*hey)(Mob *callee);
private:
vec2 pxy;
World *exit;
+ Mob *mmob;
public:
- Arena(World *leave,Player *p);
+ Arena(World *leave,Player *p,Mob *m);
~Arena(void);
World *exitArena(Player *p);
};
Mob::Mob(int sub){
type = MOBT;
+ aggressive = false;
maxHealth = health = 50;
void Mob::wander(int timeRun){
static int direction; //variable to decide what direction the entity moves
static unsigned int heya=0,hi=0;
+ static bool YAYA = false;
+
+ if(aggressive && !YAYA &&
+ player->loc.x + (width / 2) > loc.x && player->loc.x + (width / 2) < loc.x + width &&
+ player->loc.y + (height / 3) > loc.y && player->loc.y + (height / 3) < loc.y + height ){
+ Arena *a = new Arena(currentWorld,player,this);
+ a->setBackground(BG_FOREST);
+ a->setBGM("assets/music/embark.wav");
+ ui::toggleWhiteFast();
+ YAYA = true;
+ ui::waitForCover();
+ YAYA = false;
+ currentWorld = a;
+ ui::toggleWhiteFast();
+ //player->health-=5;
+ }
+
switch(subtype){
case MS_RABBIT:
if(!ticksToUse){
case SDLK_s:
break;
case SDLK_w:
- /*if(inBattle){
+ if(inBattle){
tmp = currentWorld;
currentWorld = ((Arena *)currentWorld)->exitArena(player);
if(tmp != currentWorld){
//delete &tmp;
toggleBlackFast();
}
- }else{*/
- if((tmp = currentWorld->goInsideStructure(player)) != currentWorld){
- delete currentWorld;
+ }else{
+ if((tmp = currentWorld->goInsideStructure(player)) != currentWorld)
currentWorld = tmp;
- }
- //}*/
+ }
break;
case SDLK_i:
/*currentWorld=currentWorld->goWorldBack(player); // Go back a layer if possible
if(width <= 0)
abort();
- lineCount = width + GEN_INC;
+ lineCount = (width + GEN_INC) / HLINE;
/*
* Allocate enough memory for the world to be stored.
current=current->infront;
goto LLLOOP;
}*/
- cx_start = current->x_start * 1.5;
- width = (-x_start) << 1;
+
+ if(current->x_start < SCREEN_WIDTH * -.5 )
+ cx_start = current->x_start * 1.5;
+ else
+ cx_start = (int)(SCREEN_WIDTH * -.5);
+
+ width = (-cx_start) << 1;
glEnable(GL_TEXTURE_2D);
* corners don't stick out.
*/
- for(auto &part : particles){if(part->behind)part->draw();}
+ for(auto &part : particles){
+ if(part->behind)
+ part->draw();
+ }
for(auto &b : current->build){
b->draw();
}
}
glBegin(GL_QUADS);
+
+ glTexCoord2i(0 ,0);glVertex2i(v_offset - (SCREEN_WIDTH / 1.5),0);
+ glTexCoord2i(64,0);glVertex2i(v_offset + (SCREEN_WIDTH / 1.5),0);
+ glTexCoord2i(64,1);glVertex2i(v_offset + (SCREEN_WIDTH / 1.5),base);
+ glTexCoord2i(0 ,1);glVertex2i(v_offset - (SCREEN_WIDTH / 1.5),base);
+
for(i=is;i<(unsigned)ie-GEN_INC;i++){
cline[i].y+=(yoff-DRAW_Y_OFFSET); // Add the y offset
if(!cline[i].y){
}
}
break;
- case PLAYERT:
- std::cout<<"RIP "<<e->name<<"."<<std::endl;
- exit(0);
+ default:
break;
}
entity.erase(entity.begin()+i);
return;
}
}
+ std::cout<<"RIP "<<e->name<<"."<<std::endl;
+ exit(0);
}
/*
for(auto &n : npc){
std::getline(iss,line);
+ if(line == "dOnE")return;
if((n->dialogIndex = std::stoi(line)) != 9999)
n->addAIFunc(commonAIFunc,false);
else n->clearAIFunc();
std::getline(iss,line);
+ if(line == "dOnE")return;
n->loc.x = std::stoi(line);
std::getline(iss,line);
+ if(line == "dOnE")return;
n->loc.y = std::stoi(line);
}
for(auto &b : build){
std::getline(iss,line);
+ if(line == "dOnE")return;
b->loc.x = std::stoi(line);
std::getline(iss,line);
+ if(line == "dOnE")return;
b->loc.y = std::stoi(line);
}
for(auto &m : mob){
std::getline(iss,line);
+ if(line == "dOnE")return;
m->loc.x = std::stoi(line);
std::getline(iss,line);
+ if(line == "dOnE")return;
m->loc.y = std::stoi(line);
}
}
IndoorWorld::~IndoorWorld(void){
- std::cout<<"A\n";
delete bgTex;
delete[] star;
delete[] line;
-
+
deleteEntities();
}
extern bool inBattle;
-Arena::Arena(World *leave,Player *p){
- generate(300);
+Arena::Arena(World *leave,Player *p,Mob *m){
+ generate(800);
addMob(MS_DOOR,100,100);
inBattle = true;
exit = leave;
pxy = p->loc;
+ mmob = m;
star = new vec2[100];
memset(star,0,100 * sizeof(vec2));
ui::toggleBlackFast();
ui::waitForCover();
p->loc = pxy;
+ mmob->alive = false;
return exit;
}else{
return this;
tmp->addMob(type,getRand() % tmp->getTheWidth() / 2,100);
else
tmp->addMob(type,spawnx,wxml->FloatAttribute("y"));
+
+ if(wxml->QueryBoolAttribute("aggressive",&dialog) == XML_NO_ERROR)
+ tmp->mob.back()->aggressive = dialog;
+
}else if(!strcmp(name,"npc")){
const char *npcname;
<?xml version="1.0"?>
<World>
<style background="0" bgm="assets/music/embark.wav" />
- <generation type="Random" width="800" />
+ <generation type="Random" width="1600" />
<link right="playerSpawnHill2.xml" />
- <mob type="1" />
+ <mob type="1" aggressive="true" />
<npc name="Ralph" hasDialog="true" />
<npc name="Johnny" hasDialog="true" />