aboutsummaryrefslogtreecommitdiffstats
path: root/src/gameplay.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-11-24 07:34:00 -0500
committerClyne Sullivan <tullivan99@gmail.com>2015-11-24 07:34:00 -0500
commit5c1be9978e4c9b18c400c051fc2b083a02b74b7a (patch)
tree2c8dbf3aea3539d2f4c6db3ef56eb1880fd14786 /src/gameplay.cpp
parent4bf3665158e71e9b20a2231428d42d400da8332f (diff)
parent19ef54b2c5ffcaefdce352c6f195a62c05c42767 (diff)
Merge branch 'master' of https://github.com/tcsullivan/gamedev
Diffstat (limited to 'src/gameplay.cpp')
-rw-r--r--src/gameplay.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 1d9fac6..52aceb8 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -6,6 +6,35 @@
extern World *currentWorld;
extern Player *player;
extern void mainLoop(void);
+extern SDL_Window *window;
+extern bool fadeEnable;
+
+void story(void){
+ for(int i=0;i<600;i++){
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ glOrtho((offset.x-SCREEN_WIDTH/2),(offset.x+SCREEN_WIDTH/2),offset.y-SCREEN_HEIGHT/2,offset.y+SCREEN_HEIGHT/2,-1,1);
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+ glEnable(GL_STENCIL_TEST);
+ glPushMatrix();
+
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_LIGHTING_BIT );
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glColor4f(0.0f,0.0f,0.0f,0.0f);
+ glRectf(-SCREEN_WIDTH/2,0,SCREEN_WIDTH/2,SCREEN_HEIGHT);
+ glColor4f(1.0f,1.0f,1.0f,1.0f);
+ ui::importantText("Oh hello, where are you?");
+ //ui::setFontSize(16);
+ //ui::putText(54,540,"BITC.");
+
+ glPopMatrix();
+ SDL_GL_SwapWindow(window);
+ }
+}
void waitForDialog(void){
do{
@@ -130,13 +159,12 @@ void initEverything(void){
test->addMob(MS_RABBIT,200,100);
test->addMob(MS_BIRD,-500,500);
-
- test->addObject(2, 500,200);
+ currentWorld->addObject(SWORD_WOOD, false, NULL, 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.
*/
currentWorld->npc[0]->addAIFunc(giveTestQuest,false);
-
}