Don't like ads? PRO users don't see any ads ;-)

Destroy Block

By: TheDuceCat on Dec 4th, 2011  |  syntax: None  |  size: 0.46 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public void destroyBlock(int x, int y) {
  2.        
  3.         int blockX = x / (int) gameScale / 16 + (int) (Math.floor(camera.getLocation().x) / 16);
  4.         int blockY = y / (int) gameScale / 16 + 1 + (int) (Math.floor(camera.getLocation().y) / 16);
  5.        
  6.         System.out.println("x: " + x + " y: " + y);
  7.         System.out.println("bx: " + blockX + " by: " + blockY);
  8.        
  9.         columns.get(blockX).setBlock(128 - blockY, new Air(blockX * 16 - camera.getLocation().x, blockY * 16 - camera.getLocation().y));
  10. }
  11.