From: drumsetmonkey Date: Fri, 20 Nov 2015 13:49:54 +0000 (-0500) Subject: Started inv ui, new item system X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=cc4cd76409894615887e0b39d7db5b722138a613;p=clyne%2Fgamedev.git Started inv ui, new item system --- cc4cd76409894615887e0b39d7db5b722138a613 diff --cc include/world.h index 3d5fdad,8f4ea51..a32c7f2 --- a/include/world.h +++ b/include/world.h @@@ -83,10 -83,9 +83,11 @@@ public void addStructure(_TYPE t,float x,float y,World *outside,World *inside); void addMob(int t,float x,float y); + void addMob(int t,float x,float y,void (*hey)()); void addNPC(float x,float y); void addObject(int, float, float); + void addObject(int, bool, char*, float, float); + //void removeObjet(Object); diff --cc main.cpp index 397c9da,1f8c58e..f6a40ec --- a/main.cpp +++ b/main.cpp @@@ -440,14 -434,13 +440,14 @@@ int main(int argc, char *argv[]) * Load a temporary background image. */ - bgDay =Texture::loadTexture("assets/bg.png" ); - bgNight =Texture::loadTexture("assets/bgn.png" ); - bgMtn =Texture::loadTexture("assets/bgFarMountain.png" ); - bgTreesFront =Texture::loadTexture("assets/bgFrontTreeTile.png" ); - bgTreesMid =Texture::loadTexture("assets/bgMidTreeTile.png" ); - bgTreesFar =Texture::loadTexture("assets/bgFarTreeTile.png" ); - + bgDay =Texture::loadTexture("assets/bg.png" ); + bgNight =Texture::loadTexture("assets/bgn.png" ); + bgMtn =Texture::loadTexture("assets/bgFarMountain.png"); + bgTreesFront =Texture::loadTexture("assets/bgFrontTree.png" ); + bgTreesMid =Texture::loadTexture("assets/bgMidTree.png" ); + bgTreesFar =Texture::loadTexture("assets/bgFarTree.png" ); + invUI =Texture::loadTexture("assets/invUI.png" ); - ++ /* * Load sprites used in the inventory menu. See src/inventory.cpp */ diff --cc src/entities.cpp index e979e33,67a564a..af32cd6 --- a/src/entities.cpp +++ b/src/entities.cpp @@@ -181,16 -171,18 +187,16 @@@ void Entity::draw(void){ //draws the e tex->bind(0); } break; - case 2: //RABBIT - if(ground == 0){ - tex->bind(0); - }else if(ground == 1){ - tex->bind(0); - } + case MS_BIRD: + tex->bind(0); + break; + case MS_TRIGGER: + goto NOPE; break; default: - break; + tex->bind(0); + break; } - }else if(type == OBJECTT){ - tex->bind(0); }else{ tex->bind(0); } diff --cc src/gameplay.cpp index 18bf327,e5d7251..92d1284 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@@ -138,9 -128,9 +157,9 @@@ void initEverything(void) test->addMob(MS_RABBIT,200,100); test->addMob(MS_BIRD,-500,500); -- - test->addObject(2, 500,200); + + currentWorld->addObject(SWORD_WOOD, 500,200); + currentWorld->addObject(FLASHLIGHT, true, "This looks important, do you want to pick it up?",600,200); /* * Link all the entities that were just created to the initial world, and setup a test AI function. */