Ejemplo n.º 1
0
 /**
  * This switchImage method uses a try-catch statement in order to switch the images for the
  * various sprite.
  */
 protected void switchImage() {
   try {
     if (++drawKey >= imageKeys.length) {
       drawKey = 0;
     }
   } catch (Exception e) {
     ErrorLogger.logError("Can't swich images " + e);
   }
 }
Ejemplo n.º 2
0
 /**
  * This GameObject class is passed down the int imageKeys and the int keyCount. the images
  *
  * @param imageKeys
  * @param keyCount
  */
 public GameObject(int[] imageKeys, int keyCount) {
   super(1, true);
   try {
     this.imageKeys = imageKeys;
     keyTime = keyCount;
     maxKeyTime = keyCount;
   } catch (Exception e) {
     ErrorLogger.logError("Can't Make Game Object " + e);
   }
 }
Ejemplo n.º 3
0
 /**
  * This calculateLocation method varies the location of the image and this occurs with the arrays;
  * the min.value and location are used.
  */
 public void calculateLocation() {
   try {
     if (location[3] != Integer.MIN_VALUE) {
       int[] frameLoc = GameRunner.getFrameLoc();
       location[2] = location[0] - frameLoc[0];
       location[3] = location[1] - frameLoc[1];
     }
   } catch (Exception e) {
     ErrorLogger.logError("Can't calculate object location " + e);
   }
 }