$x = $this->window->getX(); $y = $this->window->getY(); $this->window->move(--$x, $y); break; case NCURSES_KEY_RIGHT: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move(++$x, $y); break; case NCURSES_KEY_UP: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move($x, --$y); break; case NCURSES_KEY_DOWN: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move($x, ++$y); break; case 27: $app->quit(); break; } } } // Create an instance of that state $state = new State(); // Create the application with a basic state $app = new Application(); $app->setState($state); $app->run();