]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
added jump page, quest light
authorClyne Sullivan <tullivan99@gmail.com>
Mon, 16 May 2016 12:43:29 +0000 (08:43 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Mon, 16 May 2016 12:43:29 +0000 (08:43 -0400)
Makefile
assets/pages/gootaJump.png [new file with mode: 0644]
assets/questlight.png [new file with mode: 0644]
brice.dat
src/entities.cpp
src/ui.cpp
xcf/questlight.xcf [new file with mode: 0644]
xml/playerSpawnHill1.xml

index 929dc66257ad1ee28085dacad2964717807e6b51..7c05c954d132cd6c790b2bd180b372d5bec86874 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,8 @@ clean:
 cleandata:
        rm -rf xml/*.dat
        rm -rf storyXML/*.dat
+       rm brice.dat
+       touch brice.dat
 
 $(EXEC): $(CXXOUTDIR)/$(CXXOBJ) main.cpp
        @echo "  CXX/LD  main"
diff --git a/assets/pages/gootaJump.png b/assets/pages/gootaJump.png
new file mode 100644 (file)
index 0000000..f9c605a
Binary files /dev/null and b/assets/pages/gootaJump.png differ
diff --git a/assets/questlight.png b/assets/questlight.png
new file mode 100644 (file)
index 0000000..d09ca7d
Binary files /dev/null and b/assets/questlight.png differ
index ea71945339f7a7cd6d35324a11df49578bb93bfc..61d57c2785952fa6cb22f35f6db947ff5ddf91d2 100644 (file)
--- a/brice.dat
+++ b/brice.dat
@@ -1,5 +1,5 @@
 2
-canSprint
-0
 canJump
 0
+canSprint
+0
index 73e7808781f3574f9fcd33ff7f6c1ca03a784ba9..8dc32e2c28873da93cf3ce3b60106e8de9eb99c1 100644 (file)
@@ -336,9 +336,28 @@ bool Entity::isNear(Entity e) {
 void NPC::drawThingy(void) const
 {
        if (dialogCount) {
-               auto w = width / 3;
-               glColor3ub(255, 255, 0);
-               glRectf(loc.x + w, loc.y + height, loc.x + w * 2, loc.y + height + w);
+               const auto w = width / 3;
+               GLfloat tex_coord[] = {
+                       0, 0, 1, 0, 1, 1,
+                       1, 1, 0, 1, 0, 0
+               };
+               const GLfloat c[4] = {
+                       loc.x + w, loc.y + height, loc.x + w * 2, loc.y + height + w
+               };
+               GLfloat coords[] = {
+                       c[0], c[1], z, c[2], c[1], z, c[2], c[3], z,
+                       c[2], c[3], z, c[0], c[3], z, c[0], c[1], z
+               };
+               
+               glUseProgram(worldShader);
+               glEnableVertexAttribArray(worldShader_attribute_coord);
+               glEnableVertexAttribArray(worldShader_attribute_tex);
+               glVertexAttribPointer(worldShader_attribute_coord, 3, GL_FLOAT, GL_FALSE, 0, coords);
+               glVertexAttribPointer(worldShader_attribute_tex, 2, GL_FLOAT, GL_FALSE, 0, tex_coord);
+               glDrawArrays(GL_TRIANGLES, 0, 6);
+               glDisableVertexAttribArray(worldShader_attribute_coord);
+               glDisableVertexAttribArray(worldShader_attribute_tex);
+               glUseProgram(0);
        }
 }
 
@@ -874,6 +893,11 @@ unsigned int Structures::spawn(BUILD_SUB sub, float x, float y) {
        return 0;
 }
 
+/*Particles::Particles(const Structures *&s, vec2 vell, Color c, float d, )
+{
+
+}*/
+
 Particles::Particles(float x, float y, float w, float h, float vx, float vy, Color c, float d)
 {
        loc = vec2 {x, y};
index a8d37d0cc139fdf72256d0176d73b6f2dd6122fe..a5bc2d7b63ca986144afc9748b9adaf2ca7b335c 100644 (file)
@@ -1437,9 +1437,9 @@ EXIT:
                         0.0, 1.0,
                         1.0, 1.0};
 
-        GLfloat backdrop[] = {offset.x - SCREEN_WIDTH / 2, offset.y - SCREEN_HEIGHT / 2, 1.0,
+        GLfloat backdrop[] = {offset.x - SCREEN_WIDTH / 2 - 1, offset.y - SCREEN_HEIGHT / 2, 1.0,
                               offset.x + SCREEN_WIDTH / 2, offset.y - SCREEN_HEIGHT / 2, 1.0,
-                              offset.x - SCREEN_WIDTH / 2, offset.y + SCREEN_HEIGHT / 2, 1.0,
+                              offset.x - SCREEN_WIDTH / 2 - 1, offset.y + SCREEN_HEIGHT / 2, 1.0,
                               offset.x + SCREEN_WIDTH / 2, offset.y + SCREEN_HEIGHT / 2, 1.0};
 
         glUniform1i(textShader_uniform_texture, 0);
diff --git a/xcf/questlight.xcf b/xcf/questlight.xcf
new file mode 100644 (file)
index 0000000..b93b4ae
Binary files /dev/null and b/xcf/questlight.xcf differ
index d886df8a4ee7144ff0e6aee616aa8ca05683e6f3..7be0e08d4f8072dd155ee7fcd7b4dd140d391209 100644 (file)
@@ -17,7 +17,8 @@
        <npc name="Johnny" hasDialog="false" x="300" />
        <npc name="Big Dave" hasDialog="true" x="300" />
 
-       <page x="-200" id="assets/pages/gootaGoFast.png" cid="canSprint" cvalue="1"/>
+       <page x="-200" id="assets/pages/gootaGoFast.png" cid="canSprint" cvalue="1" />
+       <page x="-500" id="assets/pages/gootaJump.png" cid="canJump" cvalue="1" />
 
        <village name="Big Dave's bagel emporium! The greatest place on earth!">
                <structure type="0" x="-300" inside="playerSpawnHill1_Building1.xml"/>