diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-05-16 08:43:29 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-05-16 08:43:29 -0400 |
commit | 3815da82430df2c1ed44858da3d8425946539b04 (patch) | |
tree | 21033ce707a1cf0f2aea222b8927b9525496a303 | |
parent | e786f4a546fd9b08d83cd3e4058a93b26e7ae6ab (diff) |
added jump page, quest light
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | assets/pages/gootaJump.png | bin | 0 -> 10573 bytes | |||
-rw-r--r-- | assets/questlight.png | bin | 0 -> 235 bytes | |||
-rw-r--r-- | brice.dat | 4 | ||||
-rw-r--r-- | src/entities.cpp | 30 | ||||
-rw-r--r-- | src/ui.cpp | 4 | ||||
-rw-r--r-- | xcf/questlight.xcf | bin | 0 -> 994 bytes | |||
-rw-r--r-- | xml/playerSpawnHill1.xml | 3 |
8 files changed, 35 insertions, 8 deletions
@@ -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 Binary files differnew file mode 100644 index 0000000..f9c605a --- /dev/null +++ b/assets/pages/gootaJump.png diff --git a/assets/questlight.png b/assets/questlight.png Binary files differnew file mode 100644 index 0000000..d09ca7d --- /dev/null +++ b/assets/questlight.png @@ -1,5 +1,5 @@ 2 -canSprint -0 canJump 0 +canSprint +0 diff --git a/src/entities.cpp b/src/entities.cpp index 73e7808..8dc32e2 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -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}; @@ -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 Binary files differnew file mode 100644 index 0000000..b93b4ae --- /dev/null +++ b/xcf/questlight.xcf diff --git a/xml/playerSpawnHill1.xml b/xml/playerSpawnHill1.xml index d886df8..7be0e08 100644 --- a/xml/playerSpawnHill1.xml +++ b/xml/playerSpawnHill1.xml @@ -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"/> |