Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Code Copywrite 2011 Ethan Gomez Gaming Studios (EGGS for short) This code may NOT be used under any circumstance without the written and exclusive permission of EGGS.
- public class wMotion implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- DwarvenEmpires.y.setValue(DwarvenEmpires.y.getValue() - moveDist);
- }
- }
- public class sMotion implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- DwarvenEmpires.y.setValue(DwarvenEmpires.y.getValue() + moveDist);
- }
- }
- public class dMotion implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- DwarvenEmpires.x.setValue(DwarvenEmpires.x.getValue() + moveDist);
- }
- }
- public class aMotion implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- DwarvenEmpires.x.setValue(DwarvenEmpires.x.getValue() - moveDist);
- }
- }
- public static class frameChangeTimer implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- imageValue1 += 1;
- imageValue2 += 1;
- if (imageValue2 >= 4) {
- imageValue2 = 0;
- }
- if (imageValue1 >= 4) {
- imageValue1 = 0;
- }
- }
- }
- //In another method...
- if (ip.isKeyPressed(Input.KEY_W)) {
- DwarvenEmpires.c.setChar(wMotion[imageValue1]);
- imageMotion.start();
- wMotionTimer.start();
- }
- if (!ip.isKeyDown(Input.KEY_W)) {
- aMotionTimer.stop();
- dMotionTimer.stop();
- sMotionTimer.stop();
- wMotionTimer.stop();
- }
- }
- if (ip.isKeyPressed(Input.KEY_S)) {
- imageMotion.start();
- sMotionTimer.start();
- DwarvenEmpires.c.setChar(sMotion[imageValue1]);
- }
- if (ip.isKeyDown(Input.KEY_S)) {
- wMotionTimer.stop();
- aMotionTimer.stop();
- dMotionTimer.stop();
- sMotionTimer.stop();
- }
- if (ip.isKeyPressed(Input.KEY_D)) {
- imageMotion.start();
- dMotionTimer.start();
- DwarvenEmpires.c.setChar(dMotion[imageValue2]);
- }
- if (!ip.isKeyDown(Input.KEY_D)) {
- wMotionTimer.stop();
- aMotionTimer.stop();
- sMotionTimer.stop();
- dMotionTimer.stop();
- }
- if (ip.isKeyPressed(Input.KEY_A)) {
- imageMotion.start();
- aMotionTimer.start();
- DwarvenEmpires.c.setChar(aMotion[imageValue2]);
- }
- if (!ip.isKeyDown(Input.KEY_A)) {
- dMotionTimer.stop();
- wMotionTimer.stop();
- sMotionTimer.stop();
- aMotionTimer.stop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement