Beispiel #1
0
 public override void run()
 {
     EventQueue.invokeLater(() => {
         frame.moveDaleks();
         frame.repaint();
         frame.taskPending = false;
     });
 }
Beispiel #2
0
            public override void keyTyped(KeyEvent e)
            {
                if (frame.whoX == -1 || frame.taskPending)
                {
                    return;
                }
                switch (e.getKeyChar())
                {
                case '1':
                    frame.moveWho(-1, 1);
                    break;

                case '2':
                    frame.moveWho(0, 1);
                    break;

                case '3':
                    frame.moveWho(1, 1);
                    break;

                case '4':
                    frame.moveWho(-1, 0);
                    break;

                case '5':
                    frame.moveDaleks();
                    break;

                case '6':
                    frame.moveWho(1, 0);
                    break;

                case '7':
                    frame.moveWho(-1, -1);
                    break;

                case '8':
                    frame.moveWho(0, -1);
                    break;

                case '9':
                    frame.moveWho(1, -1);
                    break;

                case 's':
                case 'S':
                    frame.sonicScrewdriver();
                    break;

                case 't':
                case 'T':
                    frame.teleport();
                    break;
                }
                frame.updateStatus();
            }