title: how to add an array of blocks in java for a minecraft 2d like game
body: <p>I've seen someone do it in a video but never understood how to make an array of blocks instead of coding each block itself. please explain how i can make rows and columns of blocks. i already can draw them but cannot draw multiple ones. if you can, explain how to add layers of blocks from my block class.</p>
  
  <p>To make a block i made a block class wich image is a block of dirt. then it has a method returning a new rectangle called getbounds. i use g2d.drawImage(block.getImage(), block.x, block.y, null); tto draw one block, but what can i do for multiple ones?</p>