Since some users are tired of getting bugged by the alerts from the original topic. I thought I open this one.
Please continue the discussion here.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | int ax = getX() - getImage().getWidth()/ 2 ; int ay = getY() - getImage().getHeight()/ 2 ; List<String> axc = new ArrayList(); System.out.println( "----This:----" ); for ( int ix= 0 ; ix<getImage().getWidth(); ix++) { int dx = ax+ix; for ( int iy= 0 ; iy<getImage().getHeight(); iy++) { int dy = ay+iy; axc.add(dx+ "," +dy); System.out.println(dx+ "," +dy); } } Actor other = (Actor)getWorld().getObjects(cls).get( 0 ); int bx = other.getX() - other.getImage().getWidth()/ 2 ; int by = other.getY() - other.getImage().getHeight()/ 2 ; List<String> bxc = new ArrayList(); System.out.println( "----Other:----" ); for ( int ix= 0 ; ix<other.getImage().getWidth(); ix++) { int dx = bx+ix; for ( int iy= 0 ; iy<other.getImage().getHeight(); iy++) { int dy = by+iy; bxc.add(dx+ "," +dy); System.out.println(dx+ "," +dy); } } for (String coordinate : axc) { if (bxc.contains(coordinate)) { System.out.println( "Found matching coordinate: " +coordinate); return true ; } } return false ; |