]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
pages
authorClyne Sullivan <tullivan99@gmail.com>
Fri, 18 Dec 2015 13:45:29 +0000 (08:45 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Fri, 18 Dec 2015 13:45:29 +0000 (08:45 -0500)
Changelog
Makefile
assets/items/ITEM_PAGE.png [new file with mode: 0644]
include/entities.h
main.cpp
src/entities.cpp
src/gameplay.cpp
xcf/page.xcf [new file with mode: 0644]

index 6d5fa3b7c5a9f64e43a4fd56d3ddf91e468d09ac..44ff8a4664fda38bd89c12a9e41ae289246d876f 100644 (file)
--- a/Changelog
+++ b/Changelog
        - fixed NPC spawning world location stuff
        - messed with threads/forks
        - re-fixed/added indoor environment; fixed indoor background
+
+12/18/2015:
+===========
+
+       - upgraded development utilities
+       - began working on pages, made sprite and handler
+       - GLSL shaders are better
+       - redid theme_jazz
index 6eeca1a8473f8ea0c4ed261bba58728049400b37..81862c0df66f1db33ac01b1a3fee1ee422a82b7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ WIN_LIBS = -lopengl32 -lglew32 -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_m
 FLAGS = -std=c++11 -Iinclude -Iinclude/freetype2 -Wall -Wextra -Werror\r
 \r
 MFLAGS64 = 64\r
+\r
 all:\r
        @echo "Building for 32-bit target"\r
        @rm -f out/*.o\r
@@ -17,11 +18,11 @@ all:
        @rm -f out64/*.o\r
        @cd src; $(MAKE) $(MFLAGS64)\r
        @echo "  CXX  main.cpp"\r
-       @g++ $(FLAGS) -m64 -o main main.cpp out64/*.o $(LIBS) -lX11\r
+       @g++ $(FLAGS) -m64 -o main main.cpp out64/*.o $(LIBS)\r
 \r
 win32:\r
        @g++ $(FLAGS) -o main main.cpp src/*.cpp $(WIN_LIBS)\r
-       \r
+\r
 clean:\r
        @echo "  RM main"\r
        @-rm -f main\r
diff --git a/assets/items/ITEM_PAGE.png b/assets/items/ITEM_PAGE.png
new file mode 100644 (file)
index 0000000..ac132c6
Binary files /dev/null and b/assets/items/ITEM_PAGE.png differ
index 6d192fe2b66a89328db183d55ac2fb10da12794d..6b8cc32569790e3ca56579e9ee3c81028c71e1c2 100644 (file)
@@ -32,7 +32,8 @@ enum MOB_SUB {
        MS_RABBIT = 1,
        MS_BIRD,
        MS_TRIGGER,
-       MS_DOOR
+       MS_DOOR,
+       MS_PAGE
 };
 
 enum BUILD_SUB{
index 7eaaa8441fe2cb117e4a55bfcbdf0711a7fbfa98..e5aba8836f733fae9d925f7ca089699484e9aeed 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -198,15 +198,11 @@ extern int  fadeIntensity;
 /*******************************************************************************
  * MAIN ************************************************************************
  *******************************************************************************/
-
-#include <X11/Xlib.h>
-
 int main(/*int argc, char *argv[]*/){
        //*argv = (char *)argc;
        gameRunning=false;
        
-       XInitThreads();
-       
        /*!
         *      (Attempt to) Initialize SDL libraries so that we can use SDL facilities and eventually
         *      make openGL calls. Exit if there was an error.
@@ -905,6 +901,7 @@ void logic(){
                                m->wander((rand()%240 + 15));   // Make the mob wander :)
                                break;
                        case MS_TRIGGER:
+                       case MS_PAGE:
                                m->wander(0);
                                break;
                        case MS_DOOR:
index c307a31d9dd00810eca8c9f6767aa8e84b0d1d01..23a4ae6a201d466110e81584a10fce1425ca6647 100644 (file)
@@ -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;
        }
index ba2c8d9f0e0d7e6d15976b6fb2be030a10cf3e19..16709291c46b1d5280b09fc1f7e4772eb7bd8eca 100644 (file)
@@ -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);
diff --git a/xcf/page.xcf b/xcf/page.xcf
new file mode 100644 (file)
index 0000000..bf39c18
Binary files /dev/null and b/xcf/page.xcf differ