diff --git a/art/background/CloudsBDayJullietje.png b/art/background/CloudsBDayJullietje.png index b27398b..77055b5 100644 Binary files a/art/background/CloudsBDayJullietje.png and b/art/background/CloudsBDayJullietje.png differ diff --git a/bin/main b/bin/main index 9aa2e0f..bb1848b 100755 Binary files a/bin/main and b/bin/main differ diff --git a/include/animationManager.h b/include/animationManager.h index 029355c..73a7ad0 100644 --- a/include/animationManager.h +++ b/include/animationManager.h @@ -26,14 +26,16 @@ public: glm::vec4 getUVsExtended(int index, int lengthX, int lengthY) { int tileX = index % dims.x; - int tileY = index / dims.x; + int tileY = index / dims.x + lengthY -1 ; int secondTileX = lengthX % dims.x; std::cout << "secondTileX: " << secondTileX << "\n"; glm::vec4 UV; UV.x = tileX / (float)dims.x; - UV.y = tileY / (float)dims.y; + UV.y = tileY / (float)dims.y ; UV.z = UV.x + (float)secondTileX / dims.x; - UV.w = UV.y - (float)lengthY / dims.y; + UV.w = UV.y - (float)1*lengthY / dims.y; + std::cout << "uvs: " << UV.x << " " << UV.y << " " << UV.z << " " << UV.w << " " + << "\n"; return UV; } }; \ No newline at end of file diff --git a/src/components/background.cpp b/src/components/background.cpp index 77b0203..3d59675 100644 --- a/src/components/background.cpp +++ b/src/components/background.cpp @@ -8,7 +8,7 @@ Cloud::Cloud(float speed, glm::vec2 pos, glm::vec2 size, int cloudIndex) {22, 2, 1}, {24, 1, 1}, {25, 3, 1}, - {42, 6, 2}}; + {42, 6, 3}}; glm::vec4 spriteUVs = spriteSheet.getUVsExtended(cloudIndexes[cloudIndex][0], cloudIndexes[cloudIndex][1], cloudIndexes[cloudIndex][2]); GLfloat vertices[] = { @@ -78,9 +78,9 @@ Background::Background() glm::vec2(xScalar - 500.0f, yScalar), glm::vec2(128.0f * (float)cloudIndexes[cloudIndex][1], 128.0f * (float)cloudIndexes[cloudIndex][2]) * sizeScalar, cloudIndex)); } - clouds.push_back(new Cloud(1.0f, - glm::vec2(1000.0f, 300.0f), - glm::vec2(128.0f * 6.0f, 128.0f * 3.0f), 4)); + // clouds.push_back(new Cloud(1.0f, + // glm::vec2(800.0f, 300.0f), + // glm::vec2(128.0f * 6.0f, 128.0f * 3.0f)*(4.0f/3.0f), 4)); } void Background::drawBackground(SpriteRenderer &renderer, float dt) {