This is not actually a Cube, it's just squares stacked on a pile to look like one. It doesn't require too much coding, it is mainly the cloning script you need.