Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision 753fa8a730d1379bc2a6283f3942f6bc4facf02f)
+++ client/Client/main.cpp	(revision b72ed16e0ea723b394ce45b4dfae0158f34d2923)
@@ -76,5 +76,6 @@
 enum STATE {
    STATE_START,
-   STATE_LOGIN // this means you're already logged in
+   STATE_LOBBY,
+   STATE_GAME
 };
 
@@ -85,6 +86,7 @@
 Window* wndLogin;
 Window* wndRegister;
-Window* wndMain;
-Window* wndMainDebug;
+Window* wndLobby;
+Window* wndGame;
+Window* wndGameDebug;
 Window* wndCurrent;
 
@@ -100,5 +102,5 @@
 TextLabel* lblRegisterStatus;
 
-// wndMain
+// wndGame
 Textbox* txtChat;
 
@@ -238,17 +240,21 @@
    cout << "Created register screen" << endl;
 
-   wndMain = new Window(0, 0, SCREEN_W, SCREEN_H);
-   wndMain->addComponent(new Textbox(95, 40, 300, 20, font));
-   wndMain->addComponent(new Button(95, 70, 60, 20, font, "Send", sendChatMessage));
-   wndMain->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
-   wndMain->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
-
-   txtChat = (Textbox*)wndMain->getComponent(0);
-
-   wndMainDebug = new Window(0, 0, SCREEN_W, SCREEN_H);
-   wndMainDebug->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
-   wndMainDebug->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
-
-   cout << "Created main screen" << endl;
+   wndLobby = new Window(0, 0, SCREEN_W, SCREEN_H);
+
+   cout << "Created lobby screen" << endl;
+
+   wndGame = new Window(0, 0, SCREEN_W, SCREEN_H);
+   wndGame->addComponent(new Textbox(95, 40, 300, 20, font));
+   wndGame->addComponent(new Button(95, 70, 60, 20, font, "Send", sendChatMessage));
+   wndGame->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
+   wndGame->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
+
+   txtChat = (Textbox*)wndGame->getComponent(0);
+
+   wndGameDebug = new Window(0, 0, SCREEN_W, SCREEN_H);
+   wndGameDebug->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
+   wndGameDebug->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
+
+   cout << "Created game screen" << endl;
 
    goToLoginScreen();
@@ -319,5 +325,5 @@
                break;
             case ALLEGRO_KEY_S:  // pickup an item next to you
-               if (state == STATE_LOGIN) {
+               if (state == STATE_LOBBY) {
                   msgTo.type = MSG_TYPE_PICKUP_FLAG;
                   memcpy(msgTo.buffer, &curPlayerId, 4);
@@ -326,5 +332,5 @@
                break;
             case ALLEGRO_KEY_D:  // drop the current item
-               if (state == STATE_LOGIN) {
+               if (state == STATE_LOBBY) {
                   // find the current player in the player list
                   map<unsigned int, Player>::iterator it;
@@ -355,5 +361,10 @@
       }
       else if(ev.type == ALLEGRO_EVENT_MOUSE_BUTTON_UP) {
-         if(wndCurrent == wndMain) {
+         if(wndCurrent == wndLobby) {
+            if (ev.mouse.button == 1) { // left click
+               state = STATE_GAME;
+               wndCurrent = wndGame;
+            }
+         }else if(wndCurrent == wndGame) {
             if (ev.mouse.button == 1) {   // left click
                msgTo.type = MSG_TYPE_PLAYER_MOVE;
@@ -414,10 +425,10 @@
          //msgProcessor.cleanAckedMessages(&outputLog);
 
-         if (debugging && wndCurrent == wndMain)
-            wndMainDebug->draw(display);
+         if (debugging && wndCurrent == wndGame)
+            wndGameDebug->draw(display);
          else
             wndCurrent->draw(display);
 
-         if(wndCurrent == wndMain) {
+         if(wndCurrent == wndGame) {
             if (!debugging)
                chatConsole.draw(font, al_map_rgb(255,255,255));
@@ -494,5 +505,8 @@
    
    delete wndLogin;
-   delete wndMain;
+   delete wndRegister;
+   delete wndLobby;
+   delete wndGame;
+   delete wndGameDebug;
 
    delete gameMap;
@@ -600,5 +614,6 @@
          break;
       }
-      case STATE_LOGIN:
+      case STATE_LOBBY:
+      case STATE_GAME:
       {
          switch(msg.type)
@@ -622,5 +637,5 @@
                else
                {
-                  wndCurrent = wndMain;
+                  wndCurrent = wndLobby;
                   
                   Player p("", "");
@@ -689,5 +704,5 @@
             case MSG_TYPE_OBJECT:
             {
-               cout << "Received object message in STATE_LOGIN." << endl;
+               cout << "Received object message in STATE_LOBBY." << endl;
 
                WorldMap::Object o(0, WorldMap::OBJECT_NONE, 0, 0);
@@ -779,5 +794,5 @@
             default:
             {
-               cout << "(STATE_LOGIN) Received invlaid message of type " << msg.type << endl;
+               cout << "(STATE_LOBBY) Received invlaid message of type " << msg.type << endl;
                break;
             }
@@ -977,5 +992,5 @@
    msgProcessor.sendMessage(&msgTo, sock, &server, &outputLog);
 
-   state = STATE_LOGIN;
+   state = STATE_LOBBY;
 }
 
