     last_y = y;
     walked = 0;
     state = MOVING;
+    newDirection = direction;
+    inputState = CATCHING_INPUT;
     pinMode(rightPin(), INPUT);
     digitalWrite(rightPin(), HIGH);
     pinMode(leftPin(), INPUT);

#include <ledtable.h>

#define NUMBER_OF_PLAYERS 4
#define MAXIMUM_NUMBER_OF_PLAYERS 8
#define STEPS_TO_HOLE 5
#define BACKGROUND_COLOR color_black

LEDTable ledtable = LEDTable(2, 20, 15, PIXELORDER<flip_xy, snake>);


const Color colors[MAXIMUM_NUMBER_OF_PLAYERS] = {color_red, color_green, color_yellow, color_violet, 
                                                 color_orange, color_darkgreen, color_darkgoldenrod, color_white};

class Effect
{
private:
  const Color colors[EFFECT_COLORS] = {color_black, color_black, color_black, color_black, color_black};
  int x;
  int y;
  uint8_t color_index;
  bool activated; 
public:
  Effect()
  {
    activated = false;
    color_index = 0;
  }

  void activate()
  {
    for (int i = 10; i; i--)
    {
      x = random(ledtable.minX(), ledtable.maxX() + 1);
      y = random(ledtable.minY(), ledtable.maxY() + 1);
      activated = ledtable.at(x, y) == BACKGROUND_COLOR;
      if (activated)
      {
        break;
      }
    }
  }

  void update()
  {
    if (activated)
    {
      paint();
      collide();
    }
  }

  void paint()
  {
    color_index = (color_index + 1) % EFFECT_COLORS;
    ledtable.fill(x, y, colors[color_index]);
  }

  void collide()
  {
    
  }
};


enum PlaterState {MOVING, EXPLODING, END_OF_EXPLOSION, DEAD};
enum PlayerDirection {DOWN = 0, LEFT = 1, UP = 2, RIGHT = 3, STANDING};
enum ButtonState {CATCHING_INPUT, WAITING_FOR_PLAYER_TO_SWITCH_BACK};

class Player
{
