bloboland

diff src/game.cc @ 5:2f4406cc341e

meh
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 19 Dec 2012 02:37:20 +0200
parents 9021a906c5d3
children
line diff
     1.1 --- a/src/game.cc	Tue Dec 18 06:13:09 2012 +0200
     1.2 +++ b/src/game.cc	Wed Dec 19 02:37:20 2012 +0200
     1.3 @@ -22,6 +22,7 @@
     1.4  
     1.5  static const float fog_color[] = {0.76, 0.64, 0.91, 1.0};
     1.6  static Vector3 gravity;
     1.7 +#define DAMPING	0.95
     1.8  
     1.9  bool game_init()
    1.10  {
    1.11 @@ -51,7 +52,7 @@
    1.12  	glClearColor(fog_color[0], fog_color[1], fog_color[2], 1.0);
    1.13  	glFogfv(GL_FOG_COLOR, fog_color);
    1.14  
    1.15 -	gravity = Vector3(0, -0.01, 0);
    1.16 +	gravity = Vector3(0, -0.5, 0);
    1.17  
    1.18  	return true;
    1.19  }
    1.20 @@ -91,9 +92,12 @@
    1.21  
    1.22  		Vector3 normal;
    1.23  		if(level->collision(b->pos, npos, &npos, &normal)) {
    1.24 -			b->velocity = b->velocity.reflection(normal);
    1.25 +			printf("%d: COLLISION (%.2f %.2f %.2f)\n", (int)i, npos.x, npos.y, npos.z);
    1.26 +			b->velocity = b->velocity.reflection(normal) * DAMPING;
    1.27  		}
    1.28 +		b->pos = npos;
    1.29  	}
    1.30 +	rend->prepare();
    1.31  }
    1.32  
    1.33  void game_render()