class EmoAction { String name = "xxx"; int[][] stateG = new int[56][56]; Boolean unlocked = true; int x = 0; int y = 0; int w = 85; int h = 20; EmoAction(String n) { name = n; // initialize empty directed graph for (int j = 0; j < stateG[0].length; j++) { for (int k = 0; k < stateG[0].length; k++) { stateG[j][k] = 0; } } } EmoAction(String n, int[][] state) { name = n; stateG = state; } void setStates(int[][] state){ stateG = state; } // We are at the row. Find the column where the state should change to! int resolveAct(int startState){ if (startState == -1) return -1; for (int i = 0; i < stateG[startState].length; i++){ if (stateG[startState][i] == 1) return i; } return -1; } void setColl(int x, int y, int wid, int hei){ this.x = x; this.y = y; w = wid; h = hei; } Boolean checkColl(){ if (mouseX < x || mouseX > (x + w) || mouseY < y || mouseY > (y + h)) return false; else return true; } }