public void keyReleased(KeyEvent e) { // #if (mov_0) int key = e.getKeyCode(); if (key == KeyEvent.VK_LEFT) { current_Player.setLeft(false); } if (key == KeyEvent.VK_RIGHT) { current_Player.setRight(false); } if (key == KeyEvent.VK_DOWN) current_Player.setDown(false); if (key == KeyEvent.VK_UP) current_Player.setUp(false); if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(2); // #endif // #if (mov_1) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_SPACE && current_Player.getLoad()==1) // current_Player.setLoad(2); // @ if (key == KeyEvent.VK_LEFT) current_Player.setLeft(false); // @ if (key == KeyEvent.VK_RIGHT) current_Player.setRight(false); // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(false); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(false); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(2); // #endif // #if (mov_2) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_LEFT) current_Player.setLeft(false); // @ if (key == KeyEvent.VK_RIGHT) current_Player.setRight(false); // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(false); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(false); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(2); // #endif // #if (mov_3) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_SPACE && // current_Player.getLoad()==1){current_Player.setLoad(2);} // @ if (key == KeyEvent.VK_LEFT) current_Player.setLeft(false); // @ if (key == KeyEvent.VK_RIGHT) current_Player.setRight(false); // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(false); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(false); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(2); // #endif // #if (mov_4) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_SPACE && current_Player.getLoad()==1) // current_Player.setLoad(2); // @ if (key == KeyEvent.VK_LEFT) current_Player.setLeft(false); // @ if (key == KeyEvent.VK_RIGHT) current_Player.setRight(false); // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(false); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(false); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(2); // #endif }
public void keyPressed(KeyEvent e) { // #if (mov_0) int key = e.getKeyCode(); if (key == KeyEvent.VK_LEFT) { current_Player.setLeft(true); } if (key == KeyEvent.VK_RIGHT) { current_Player.setRight(true); } if (key == KeyEvent.VK_DOWN) current_Player.setDown(true); if (key == KeyEvent.VK_UP) current_Player.setUp(true); if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(3); if (key == KeyEvent.VK_ENTER) if (current_Player.getSch().isIsActive() == false) changepl(); if (key == KeyEvent.VK_F1) ls.createNewPlayer(); // #if(tar) // @ if (key == KeyEvent.VK_Q){ // @ // current_Player.setRocket(true); // @ // sch = new Schuss((int)current_Player.getX(),(int)current_Player.getY()); // @ // current_Player.setBp(0); // @ } // #endif // #elif (mov_1) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_LEFT){ // @ current_Player.setLeft(true); // @ } // @ if (key == KeyEvent.VK_RIGHT){ // @ current_Player.setRight(true); // @ } // @ if (key == KeyEvent.VK_SPACE && current_Player.getLoad() < 2){ // @ current_Player.setBp(current_Player.getBp()+5); // @ current_Player.setLoad(1); // @ } // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(true); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(true); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(3); // @ if (key == KeyEvent.VK_ENTER) if (current_Player.getSch().isIsActive()==false) // changepl(); // @ if (key == KeyEvent.VK_F1) ls.createNewPlayer(); // #elif (mov_2) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_LEFT) current_Player.setLeft(true); // @ if (key == KeyEvent.VK_RIGHT) current_Player.setRight(true); // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(true); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(true); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(3); // @ if (key == KeyEvent.VK_ENTER) if (current_Player.getSch().isIsActive()==false) // changepl(); // @ if (key == KeyEvent.VK_F1) ls.createNewPlayer(); // #elif (mov_3) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_LEFT){ // @ current_Player.setLeft(true); // @ } // @ if (key == KeyEvent.VK_RIGHT){ // @ current_Player.setRight(true); // @ } // @ if (key == KeyEvent.VK_SPACE){ // @ current_Player.setBp(current_Player.getBp()+5); // @ current_Player.setLoad(1); // @ //current_Player.setSpeed(5); // @ } // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(true); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(true); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(3); // @ if (key == KeyEvent.VK_ENTER) if (current_Player.getSch().isIsActive()==false) // changepl(); // @ if (key == KeyEvent.VK_F1) ls.createNewPlayer(); // #elif (mov_4) // @ int key = e.getKeyCode(); // @ if (key == KeyEvent.VK_LEFT){ // @ current_Player.setLeft(true); // @ } // @ if (key == KeyEvent.VK_RIGHT){ // @ current_Player.setRight(true); // @ } // @ if (key == KeyEvent.VK_SPACE && current_Player.getLoad() < 2){ // @ current_Player.setBp(current_Player.getBp()+5); // @ current_Player.setLoad(1); // @ } // @ if (key == KeyEvent.VK_DOWN) current_Player.setDown(true); // @ if (key == KeyEvent.VK_UP) current_Player.setUp(true); // @ if (key == KeyEvent.VK_SHIFT) current_Player.setSpeed(3); // @ if (key == KeyEvent.VK_ENTER) if (current_Player.getSch().isIsActive()==false) // changepl(); // @ if (key == KeyEvent.VK_F1) ls.createNewPlayer(); // #endif // neu beginn if (key == KeyEvent.VK_Q) { // #if (tar) // @ current_Player.setRocket(true); // @ sch = new Schuss((int)current_Player.getX(),(int)current_Player.getY()); // @ current_Player.setBp(0); // #endif } // neu ende }