From: Clyne Sullivan Date: Mon, 16 May 2016 12:43:29 +0000 (-0400) Subject: added jump page, quest light X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=3815da82430df2c1ed44858da3d8425946539b04;p=clyne%2Fgamedev.git added jump page, quest light --- diff --git a/Makefile b/Makefile index 929dc66..7c05c95 100644 --- 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 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 index 0000000..d09ca7d Binary files /dev/null and b/assets/questlight.png differ diff --git a/brice.dat b/brice.dat index ea71945..61d57c2 100644 --- a/brice.dat +++ b/brice.dat @@ -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}; diff --git a/src/ui.cpp b/src/ui.cpp index a8d37d0..a5bc2d7 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -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 index 0000000..b93b4ae Binary files /dev/null and b/xcf/questlight.xcf differ 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 @@ - + +