summaryrefslogtreecommitdiffstats
path: root/src/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game.cpp')
-rw-r--r--src/Game.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Game.cpp b/src/Game.cpp
index e629aca..604eb64 100644
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -94,7 +94,7 @@ void Game::turn(float x, float y) {
void Game::run(int delta) {
lightPos += delta*0.5;
- lightPos = std::fmod(lightPos, 24000);
+ lightPos = std::fmod(lightPos, 26000);
vmml::vec3f playerMove(vmml::vec3f::ZERO);
@@ -119,20 +119,24 @@ void Game::render() {
int i;
vmml::vec3f light(vmml::vec3f::ZERO);
- if(lightPos < 12000) i = lightPos;
- else i = 24000 - lightPos;
+ if(lightPos < 13000) i = lightPos;
+ else i = 26000 - lightPos;
- if(i < 4000) {
+ if(i < 500) {
light.x() = 0.0;
- light.z() = -i * 0.001;
+ light.z() = 0.0;
}
- else if(i < 8000) {
- light.x() = (i-4000) * 0.001;
+ else if(i < 4500) {
+ light.x() = 0.0;
+ light.z() = -(i-500) * 0.001;
+ }
+ else if(i < 8500) {
+ light.x() = (i-4500) * 0.001;
light.z() = -4.0;
}
- else if(i < 12000) {
+ else if(i < 12500) {
light.x() = 4.0;
- light.z() = -4.0 - (i-8000) * 0.001;
+ light.z() = -4.0 - (i-8500) * 0.001;
}
else {
light.x() = 4.0;