Do I need "cube subclasses" to represent the blocks in a Minecraft-like world?

Posted by stighy on Game Development See other posts from Game Development or by stighy
Published on 2013-10-28T11:07:24Z Indexed on 2013/10/28 16:16 UTC
Read the original article Hit count: 221

Filed under:

I would like to try to develop a very simple game like Minecraft for my own education.

My main problem at the moment is figuring out how to model classes that represent the world, which will be made of blocks of various types (such as dirt, stone and sand).

I am thinking of creating the following class structure:

  • Cube (with proprerties like color, strength, flammable, gravity) with subclasses:
    • Dirt
    • Stone
    • Sand
    • et cetera

My question is, do I need the Cube subclasses or a single class Cube sufficient?

© Game Development or respective owner

Related posts about minecraft