From e03619c9dd92cf044cc06090af4061bbebd2cb76 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 2 Dec 2015 07:38:27 -0500 Subject: fixed item dialog --- Changelog | 7 +++++++ Goals.txt | 7 +++++++ src/entities.cpp | 21 +++++++++++---------- src/gameplay.cpp | 3 --- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Changelog b/Changelog index c09d63a..f1e8841 100644 --- a/Changelog +++ b/Changelog @@ -348,3 +348,10 @@ - began writing songs for game soundtrack ~ About 4280 lines of code + documentation written ( +7ish pages of story on gdoc) + +12/1/2015: +========== + + - ran game through valgrind, fixed almost all memory leaks/errors + - smoothed out game animations + - broke the game diff --git a/Goals.txt b/Goals.txt index 0164d82..208c7e5 100644 --- a/Goals.txt +++ b/Goals.txt @@ -22,6 +22,13 @@ End of November: - work on GLSL shaders to replace the current 'fake' ones - redesign what currently exists to match what is desired +Summary: + Textures have been formalized, with a namespace and class for loading and using textures. The +idea of a parallaxed background was applied, with up to four layers of tiled background material. +Combinations of background layers were sorted and added to the World class with a World::setBackground() +function. The inventory was created, with an animated inventory view based off of the player finished +by the end of the month. + End of December: ================ diff --git a/src/entities.cpp b/src/entities.cpp index 7dc561b..1e6fad5 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -341,17 +341,18 @@ void NPC::interact(){ //have the npc's interact back to the player extern void waitForDialog(void); void Object::interact(void){ - if(questObject){ - char opt[]=":Yes:No"; - ui::dialogBox("You",opt,pickupDialog); - do{ - if(ui::dialogOptChosen == 1 && this->alive == true){ - player->inv->addItem((ITEM_ID)(identifier), (char)1); - this->alive = false; - } - }while(ui::dialogBoxExists); + if(questObject && alive){ + + ui::dialogBox("You",":Yes:No",pickupDialog); + while(ui::dialogBoxExists); + + if(ui::dialogOptChosen == 1 && alive){ + player->inv->addItem((ITEM_ID)(identifier), (char)1); + alive = false; + return; + } }else{ - this->alive = false; + alive = false; player->inv->addItem((ITEM_ID)(identifier), (char)1); } } diff --git a/src/gameplay.cpp b/src/gameplay.cpp index a4fec88..cc9ae6a 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -76,11 +76,8 @@ void initEverything(void){ playerSpawnHill=new World(); playerSpawnHill->setBackground(BG_FOREST); -<<<<<<< Updated upstream playerSpawnHill->generateFunc(1280,playerSpawnHillFunc); //playerSpawnHill->generate(1920); -======= ->>>>>>> Stashed changes /* * Setup the current world, making the player initially spawn in `test`. -- cgit v1.2.3