Index: /orxonox/trunk/core/Makefile
===================================================================
--- /orxonox/trunk/core/Makefile	(revision 1871)
+++ /orxonox/trunk/core/Makefile	(revision 1872)
@@ -39,5 +39,6 @@
 	npc.o \
 	player.o \
-	world.o 
+	world.o \
+	input_output.o
 
 TARGET = orxonox
Index: /orxonox/trunk/core/input_output.cc
===================================================================
--- /orxonox/trunk/core/input_output.cc	(revision 1872)
+++ /orxonox/trunk/core/input_output.cc	(revision 1872)
@@ -0,0 +1,68 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: ...
+   co-programmer: ...
+*/
+
+
+#include "input_output.h"
+#include <iostream>
+
+using namespace std;
+
+
+/** 
+   \brief InputOutput Module for each player
+   \param wld A reference to the game-world
+   
+   This Class registers all moves, a player makes and passes it to the player object. ToDo: extend to support network players...
+*/
+InputOutput::InputOutput (World* world, Player* player) 
+{
+  this->world = world;
+  this->player = player;
+}
+
+
+
+InputOutput::~InputOutput () {}
+
+
+
+void InputOutput::goUp() 
+{
+  (*player).goX(BASE_STEP);
+}
+
+void InputOutput::goDown() 
+{
+  (*player).goX(-BASE_STEP);
+}
+
+void InputOutput::goLeft()
+{
+  cout << "left";
+  (*player).goY(-BASE_STEP);
+}
+
+void InputOutput::goRight()
+{
+  cout << "right";
+  (*player).goY(BASE_STEP);
+}
+
+void InputOutput::shoot()
+{
+  (*player).shoot(BASE_STEP);
+}
Index: /orxonox/trunk/core/input_output.h
===================================================================
--- /orxonox/trunk/core/input_output.h	(revision 1872)
+++ /orxonox/trunk/core/input_output.h	(revision 1872)
@@ -0,0 +1,32 @@
+
+
+
+#ifndef INPUT_OUTPUT_H
+#define INPUT_OUTPUT_H
+
+#include "world.h"
+#include "input_output.h"
+#include "player.h"
+
+#define BASE_STEP 5
+
+class InputOutput {
+
+ private:
+  World* world;
+  Player* player;
+
+ public:
+  InputOutput (World* wld, Player* player);
+  ~InputOutput ();
+
+  void goUp(void);
+  void goDown(void);
+  void goLeft(void);
+  void goRight(void);
+  void shoot(void);
+
+
+};
+
+#endif
Index: /orxonox/trunk/core/orxonox.cc
===================================================================
--- /orxonox/trunk/core/orxonox.cc	(revision 1871)
+++ /orxonox/trunk/core/orxonox.cc	(revision 1872)
@@ -24,19 +24,7 @@
 */
 
-
-
-
-
-
 /* class definition header */
 #include "orxonox.h"
-#include "data_tank.h"
-
-/* standard headers */
-#include <iostream>
-#include <cstdio>
-
-/* openGL Headers */
-#include <GL/glut.h>
+
 
 using namespace std;
@@ -44,5 +32,8 @@
 
 
-Orxonox::Orxonox () {}
+Orxonox::Orxonox () 
+{
+  pause = false;
+}
 
 
@@ -53,4 +44,9 @@
 /* this is a singleton class to prevent dublicates */
 Orxonox* Orxonox::singleton_ref = 0;
+World* Orxonox::world = 0;
+InputOutput* Orxonox::io = 0;
+bool Orxonox::pause = false;
+
+
 Orxonox* Orxonox::getInstance (void)
 {
@@ -59,5 +55,4 @@
   return singleton_ref;
 }
-
 
 
@@ -69,23 +64,31 @@
   glutInitWindowPosition(100, 100);
   glutCreateWindow("orxOnox");
+  glShadeModel(GL_FLAT);
   /* window event dispatchers */
   glutDisplayFunc(display);
   glutReshapeFunc(reshape);
   glutKeyboardFunc(keyboard);
+}
+
+
+int Orxonox::menuInit (void)
+{
+  glClearColor(0.0, 0.0, 0.0, 0.0);
+}
+
+
+int Orxonox::gameInit (void) 
+{
+  glClearColor(0.0, 0.0, 0.0, 0.0);
+  world = new World;
+  Player* localPlayer = new Player;
+  io = new InputOutput(world, localPlayer);
+  (*world).addPlayer(localPlayer);
+  //  (*localPlayer).addIO(io);
+
   glutSpecialFunc(specFunc); 
-}
-
-
-
-int Orxonox::menuInit (void)
-{
-  glClearColor(0.0, 0.0, 0.0, 0.0);
-}
-
-
-
-int Orxonox::gameInit (void) 
-{
-
+
+  //for testing purps only
+  //testTheShit();
 }
 
@@ -94,4 +97,19 @@
 {
   switch(key) {
+
+  case 'p':
+    if (pause) 
+      {
+	cout << "unset pause" << endl;
+	glutIdleFunc(continousRedraw);
+	pause = false;
+      }
+    else 
+      {
+	cout << "set pause" << endl;
+	glutIdleFunc(NULL);
+	pause = true;
+      }
+    break;
   case 27:
     exit(0);
@@ -101,4 +119,9 @@
 
 
+/** 
+   \brief special keys function. called by glut
+   
+   Here are all special key function defined.
+*/
 void Orxonox::specFunc(int key, int x, int y)
 {
@@ -106,13 +129,17 @@
   case GLUT_KEY_UP:
     cout << "key_up" << endl;
+    (*io).goUp();
     break;
   case GLUT_KEY_DOWN:
     cout << "key_down" << endl;
+    (*io).goDown();
     break;
   case GLUT_KEY_RIGHT:
     cout << "key_right" << endl;
+    (*io).goRight();
     break;
   case GLUT_KEY_LEFT:
     cout << "key_left" << endl;
+    (*io).goLeft();
     break;
   }
@@ -120,10 +147,16 @@
 
 
-void Orxonox::display (void) 
+void Orxonox::display() 
 {
   glClear(GL_COLOR_BUFFER_BIT);
+  (*world).drawWorld();
   glutSwapBuffers();
 } 
 
+
+void Orxonox::continousRedraw()
+{
+  glutPostRedisplay();
+}
 
 
@@ -139,4 +172,20 @@
 
 
+void Orxonox::testTheShit() 
+{
+  Player* pl = new Player;
+  (*pl).setPosition(1, 1, 1);
+  (*world).addPlayer(pl);
+  
+  //NPC* nl = new NPC;
+  //(*world).addNPC(nl);
+  //(*world).addNPC(nl);
+  //(*world).addNPC(nl);
+  //(*world).addNPC(nl);
+  //(*world).addNPC(nl);
+  //(*world).addNPC(nl);
+  //(*world).testThaTest();
+}
+
 
 int main (int argc, char** argv) 
@@ -144,21 +193,6 @@
   Orxonox *orx = Orxonox::getInstance();
   (*orx).globalInit(argc, argv);
-  (*orx).menuInit();
-
-  World* wd = new World;
-  Player* pl = new Player;
-  (*wd).addPlayer(pl);
-  (*wd).addPlayer(pl);
-  (*wd).addPlayer(pl);
-  (*wd).addPlayer(pl);
-
-  NPC* nl = new NPC;
-  (*wd).addNPC(nl);
-  (*wd).addNPC(nl);
-  (*wd).addNPC(nl);
-  (*wd).addNPC(nl);
-  (*wd).addNPC(nl);
-  (*wd).addNPC(nl);
-  (*wd).testThaTest();
+  //(*orx).menuInit(); pb: directly jump to the game, no menu
+  (*orx).gameInit();
 
   glutMainLoop();  
Index: /orxonox/trunk/core/orxonox.h
===================================================================
--- /orxonox/trunk/core/orxonox.h	(revision 1871)
+++ /orxonox/trunk/core/orxonox.h	(revision 1872)
@@ -1,16 +1,31 @@
 
-#include "world.h"
+
 
 #ifndef ORXONOX_H
 #define ORXONOX_H
 
-#define NULL 0
+/* standard headers */
+#include <iostream>
+#include <cstdio>
+
+/* openGL Headers */
+#include <GL/glut.h>
+
+#include "world.h"
+#include "input_output.h"
+#include "data_tank.h"
+#include "stdincl.h"
+
+
 
 class Orxonox {
 
  private:
-  static Orxonox *singleton_ref;
+  static Orxonox* singleton_ref;
   Orxonox ();
   ~Orxonox ();
+  static World* world;
+  static InputOutput* io;
+  static bool pause;
 
  public:
@@ -21,5 +36,7 @@
   int menuInit (void);
   int gameInit (void);
+  void testTheShit(void);
   static void display (void);
+  static void continousRedraw(void);
   static void reshape (int w, int h);
   static void keyboard(unsigned char key, int x, int y);
Index: /orxonox/trunk/core/player.cc
===================================================================
--- /orxonox/trunk/core/player.cc	(revision 1871)
+++ /orxonox/trunk/core/player.cc	(revision 1872)
@@ -10,4 +10,8 @@
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer:
 */
 
@@ -19,5 +23,7 @@
 
 
-Player::Player () {}
+Player::Player () {
+  xCor = yCor = zCor = 0;
+}
 
 
@@ -31,7 +37,39 @@
 }
 
+void Player::getPosition(int* x, int* y, int* z) 
+{
+  *x = xCor; *y = yCor; *z = zCor;
+}
+
+void Player::goX(int x) 
+{
+  // (*player).goUp();
+  xCor += x;
+  cout << "goX now..." << endl;
+}
+
+
+void Player::goY(int y)
+{
+  yCor += y;
+}
+
+void Player::goZ(int z)
+{
+  zCor += z;
+}
+
+void Player::shoot(int n) {
+}
+
+
+//void Player::addIO(InputOutput *io) {}
+
 
 void Player::drawPlayer(void) 
 {
-  cout << "Player::drawPlayer()" << endl;
+  //cout << "Player::drawPlayer()" << endl;
+  glColor3f(1.0, 0.9, 0.4);
+  glRectf(-5.0 + yCor, -5.0 + xCor, 5.0 + yCor, 5.0 + xCor);
+  cout << "x: " << xCor << " y: " << yCor << endl;
 }
Index: /orxonox/trunk/core/player.h
===================================================================
--- /orxonox/trunk/core/player.h	(revision 1871)
+++ /orxonox/trunk/core/player.h	(revision 1872)
@@ -3,4 +3,8 @@
 #define PLAYER_H
 
+/* openGL Headers */
+#include <GL/glut.h>
+
+//#include "input_output.h"
 
 class Player {
@@ -12,4 +16,9 @@
   void setPosition(int x, int y, int z);
   void getPosition(int* x, int* y, int* z);
+  void goX(int x);
+  void goY(int y);
+  void goZ(int x);
+  void shoot(int n);
+  //  void addIO(InputOutput *io);
   void drawPlayer(void);
 
Index: /orxonox/trunk/core/world.cc
===================================================================
--- /orxonox/trunk/core/world.cc	(revision 1871)
+++ /orxonox/trunk/core/world.cc	(revision 1872)
@@ -70,4 +70,9 @@
 bool World::removePlayer(Player* player) {
   cout << "World::removeNPC not implemented yet" << endl;
+}
+
+Player* World::getLocalPlayer() 
+{
+  return localPlayer;
 }
 
Index: /orxonox/trunk/core/world.h
===================================================================
--- /orxonox/trunk/core/world.h	(revision 1871)
+++ /orxonox/trunk/core/world.h	(revision 1872)
@@ -1,10 +1,11 @@
+
+
+
+#ifndef WORLD_H
+#define WORLD_H
 
 #include "npc.h"
 #include "player.h"
 #include "stdincl.h"
-
-#ifndef WORLD_H
-#define WORLD_H
-
 
 class World {
@@ -15,4 +16,5 @@
 
   /* for easier use: map the first two player here */
+  Player *localPlayer;
   Player *player1;
   Player *player2;
@@ -36,4 +38,5 @@
   bool addPlayer(Player* player);
   bool removePlayer(Player* player);
+  Player* getLocalPlayer();
 
   bool addNPC(NPC* npc);
