diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/entities.cpp | 22 | ||||
-rw-r--r-- | src/gameplay.cpp | 31 |
2 files changed, 42 insertions, 11 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index c307a31..23a4ae6 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -1,7 +1,7 @@ #include <entities.h> #include <ui.h> -#include <unistd.h> +//#include <unistd.h> extern FILE* names; extern unsigned int loops; @@ -153,15 +153,22 @@ Mob::Mob(int sub){ width = HLINE * 8; height = HLINE * 8; tex = new Texturec(1, "assets/robin.png"); + break; case MS_TRIGGER: width = HLINE * 20; height = 2000; tex = new Texturec(0); + break; case MS_DOOR: width = HLINE * 12; height = HLINE * 19; tex = new Texturec(1,"assets/door.png"); break; + case MS_PAGE: + width = HLINE * 6; + height = HLINE * 4; + tex = new Texturec(1,"assets/items/ITEM_PAGE.png"); + break; } inv = new Inventory(NPC_INV_SIZE); @@ -248,6 +255,7 @@ void Entity::draw(void){ //draws the entities break; case MS_BIRD: case MS_DOOR: + case MS_PAGE: default: tex->bind(0); break; @@ -471,7 +479,17 @@ void Mob::wander(int timeRun){ } break; - case MS_DOOR: + case MS_PAGE: + if(ui::mouse.x > loc.x && + ui::mouse.x < loc.x + width && + SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT)){ + if(speed != 666){ + speed = 666; + hey(this); + speed = 0; + } + } + break; default: break; } diff --git a/src/gameplay.cpp b/src/gameplay.cpp index ba2c8d9..1670929 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -51,14 +51,27 @@ void worldSpawnHill1_hillBlock(Mob *callee){ static Arena *a; void worldSpawnHill2_infoSprint(Mob *callee){ - callee->alive = false; - a = new Arena(currentWorld,player); - a->setBackground(BG_FOREST); - a->setBGM("assets/music/embark.wav"); - ui::toggleWhiteFast(); - ui::waitForCover(); - currentWorld = a; - ui::toggleWhiteFast(); + + ui::dialogBox(player->name,":Nah:Sure",false,"This page would like to take you somewhere."); + ui::waitForDialog(); + switch(ui::dialogOptChosen){ + case 1: + ui::dialogBox(player->name,NULL,true,"Cool."); + callee->alive = false; + a = new Arena(currentWorld,player); + a->setBackground(BG_FOREST); + a->setBGM("assets/music/embark.wav"); + ui::toggleWhiteFast(); + ui::waitForCover(); + currentWorld = a; + ui::toggleWhiteFast(); + break; + case 2: + default: + ui::dialogBox(player->name,NULL,false,"Okay then."); + break; + } + //ui::dialogBox("B-) ",NULL,true,"Press \'Shift\' to run!"); } @@ -113,7 +126,7 @@ void initEverything(void){ worldSpawnHill2->generate(700); worldSpawnHill2->setBackground(BG_FOREST); worldSpawnHill2->setBGM("assets/music/ozone.wav"); - worldSpawnHill2->addMob(MS_TRIGGER,-400,0,worldSpawnHill2_infoSprint); + worldSpawnHill2->addMob(MS_PAGE,-400,0,worldSpawnHill2_infoSprint); worldSpawnHill3 = new World(); worldSpawnHill3->generateFunc(1000,gen_worldSpawnHill3); |