Final version of Beta 1

- made the world a little smaller such that there is only little space off screen
main
Martin Felis (berta win) 2010-12-01 10:48:10 +01:00
parent 263a80a1fd
commit 1a30c7583c
3 changed files with 11 additions and 9 deletions

View File

@ -57,7 +57,7 @@ int Model::OnInit (int argc, char* argv[]) {
// Reset the newest highscore entry index which may be used for highlighting // Reset the newest highscore entry index which may be used for highlighting
// the newest entry. // the newest entry.
mNewestHighscoreEntryIndex = 99999; mNewestHighscoreEntryIndex = std::numeric_limits<unsigned int>::max();
// initialize event handlers and register them // initialize event handlers and register them
Engine::RegisterListener (this, EventGameOver); Engine::RegisterListener (this, EventGameOver);

View File

@ -49,9 +49,9 @@ int View::OnInit (int argc, char* argv[]) {
int i; int i;
for (i = 0; i < 200; i++) { for (i = 0; i < 200; i++) {
BackgroundStar star; BackgroundStar star;
star.position[0] = rand() / float(RAND_MAX); star.position[0] = rand() / float(RAND_MAX) * 1.2;
star.position[1] = rand() / float(RAND_MAX); star.position[1] = rand() / float(RAND_MAX) * 1.2;
star.position[2] = rand() / float(RAND_MAX); star.position[2] = rand() / float(RAND_MAX) * 1.2;
mBackgroundStars.push_back (star); mBackgroundStars.push_back (star);
} }
@ -211,10 +211,12 @@ void View::DrawStars() {
mBackgroundStars.at(i).position -= vector3d(Engine::GetFrameDuration() * 0.7 * mBackgroundStars.at(i).position[1] / world_width, 0., 0.); mBackgroundStars.at(i).position -= vector3d(Engine::GetFrameDuration() * 0.7 * mBackgroundStars.at(i).position[1] / world_width, 0., 0.);
if (mBackgroundStars.at(i).position[0] < 0.) // we move the stars a little more such that they are not blende out too early
mBackgroundStars.at(i).position[0] += 1.; // \todo compute proper bounds from Physics world size!
if (mBackgroundStars.at(i).position[0] >= 1.) if (mBackgroundStars.at(i).position[0] < -0.1)
mBackgroundStars.at(i).position[0] -= 1.; mBackgroundStars.at(i).position[0] += 1.2;
if (mBackgroundStars.at(i).position[0] >= 1.1)
mBackgroundStars.at(i).position[0] -= 1.2;
} }
glEnd(); glEnd();

View File

@ -51,7 +51,7 @@ int main (int argc, char* argv[]) {
SDL_WM_SetCaption("Asteroids -BETA1-","Asteroids -BETA 1-"); SDL_WM_SetCaption("Asteroids -BETA1-","Asteroids -BETA 1-");
engine.GetView()->SetGridSize (8,8); engine.GetView()->SetGridSize (8,8);
dynamic_cast<asteroids::Physics*>(engine.GetPhysics())->SetWorldSize (28, 20); dynamic_cast<asteroids::Physics*>(engine.GetPhysics())->SetWorldSize (26, 20);
// run the default commands and load the configuration // run the default commands and load the configuration
Engine::RunCommand ("exec asteroids.rc"); Engine::RunCommand ("exec asteroids.rc");