diff --git a/asteroids.rc b/asteroids.rc new file mode 100644 index 0000000..74d6a0f --- /dev/null +++ b/asteroids.rc @@ -0,0 +1,10 @@ +# controls +bind up +forward +bind left +turnleft +bind right +turnright +bind space attack + +# set some game variables +set ship_maxspeed 10 +set ship_acceleration 10 +set ship_rotationspeed 180 diff --git a/asteroids/AsteroidEntity.cc b/asteroids/AsteroidEntity.cc index d620bf5..aa923a3 100644 --- a/asteroids/AsteroidEntity.cc +++ b/asteroids/AsteroidEntity.cc @@ -14,7 +14,7 @@ namespace asteroids { bool AsteroidEntity::CollisionEvent (Engine::EntityBase* entity_state) { GameEntityType other_type = (GameEntityType) entity_state->mType; - Engine::LogMessage ("CONTACT OF AN ASTEROID"); + Engine::LogDebug ("CONTACT OF AN ASTEROID"); if (other_type == GameEntityTypeRocket) { // First remove the rocket diff --git a/asteroids/Controller.cc b/asteroids/Controller.cc index b0ffeee..69c3de9 100644 --- a/asteroids/Controller.cc +++ b/asteroids/Controller.cc @@ -11,10 +11,6 @@ int Controller::OnInit (int argc, char *argv[]) { mBindings[SDLK_h] = "+turnleft"; mBindings[SDLK_g] = "+turnright"; - mBindings[SDLK_UP] = "+forward"; - mBindings[SDLK_LEFT] = "+turnleft"; - mBindings[SDLK_RIGHT] = "+turnright"; - mBindings[SDLK_SPACE] = "attack"; mBindings[SDLK_F8] = "toggleconsole"; diff --git a/asteroids/MenuOverlay.cc b/asteroids/MenuOverlay.cc index 95bb046..362be25 100644 --- a/asteroids/MenuOverlay.cc +++ b/asteroids/MenuOverlay.cc @@ -146,7 +146,9 @@ void MenuOverlay::DrawGameRunning() { void MenuOverlay::DrawPlayerDied () { std::ostringstream topbar_stream; topbar_stream << "You died ..."; - Engine::DrawGLString ( right * 0.5 - 80, bottom * 0.5 - 8, topbar_stream.str().c_str ()); + Engine::DrawGLString ( right * 0.5 - 40, bottom * 0.5 - 8 - 32, topbar_stream.str().c_str ()); + + Engine::DrawGLString ( right * 0.5 - 90, bottom * 0.5 + 8, "Press [Return] to continue."); } void MenuOverlay::DrawGameOverScreen() { diff --git a/asteroids/Model.cc b/asteroids/Model.cc index e5d2765..1126ecc 100644 --- a/asteroids/Model.cc +++ b/asteroids/Model.cc @@ -85,9 +85,8 @@ int Model::DoLoadLevel (const char* filename) { while (level_file >> entity_type_str) { if (entity_type_str[0] == '#') { - std::cout << "Read Comment: " << entity_type_str; getline (level_file, entity_type_str); - std::cout << entity_type_str << std::endl; + Engine::LogDebug ("Read Comment: %s", entity_type_str.c_str()); continue; } diff --git a/asteroids/ShipEntity.cc b/asteroids/ShipEntity.cc index ab63b14..aaf60a0 100644 --- a/asteroids/ShipEntity.cc +++ b/asteroids/ShipEntity.cc @@ -99,8 +99,6 @@ void ShipEntity::Attack () { if (!mAlive) return; - Engine::LogMessage ("ATTACK"); - Engine::EntityPhysicState* entity_physic = Engine::GetEntityPhysicState (mId); vector3d attack_dir (1., 0., 0.); diff --git a/asteroids/View.cc b/asteroids/View.cc index 1e7cb4a..dcc9458 100644 --- a/asteroids/View.cc +++ b/asteroids/View.cc @@ -82,7 +82,7 @@ bool View::AccelerateEventHandler::HandleEvent (const Engine::EventBasePtr &even if (event->mEventType == EventAccelerateStart) mView->mShipThrustSprite.ResetAnimation(); - Engine::LogMessage ("Received Acceleration Event: %d", event->mEventType); + Engine::LogDebug ("Received Acceleration Event: %d", event->mEventType); return true; } @@ -108,7 +108,7 @@ bool View::ShipExplodeEventHandler::HandleEvent (const Engine::EventBasePtr &eve } } - Engine::LogMessage ("Received Ship Explode Event: %d", event->mEventType); + Engine::LogDebug ("Received Ship Explode Event: %d", event->mEventType); return true; } diff --git a/asteroids/main.cc b/asteroids/main.cc index e51ecb0..fcf4a1c 100644 --- a/asteroids/main.cc +++ b/asteroids/main.cc @@ -22,7 +22,7 @@ int main (int argc, char* argv[]) { engine.SetPhysics (new asteroids::Physics); engine.SetView (new asteroids::View); - SetLogPrintLevel (Engine::LogLevelDebug); + SetLogPrintLevel (Engine::LogLevelMessage); if (engine.Init (argc, argv) != 0) { cout << "Could not start engine!" << endl; @@ -32,7 +32,7 @@ int main (int argc, char* argv[]) { engine.GetView()->SetGridSize (8,8); dynamic_cast(engine.GetPhysics())->SetWorldSize (28, 20); - SetLogPrintLevel (Engine::LogLevelDebug); + Engine::RunCommand ("exec asteroids.rc"); engine.MainLoop ();