Quote:Is there a way to specify a constructor to use and use it?
No, but you can define and use the default constructor, and then assign over those values.
Quote:Or would I have to make the tetromino a double pointer and declare each individually?
Please wipe this idea from your head. You should never explicitly make your data structure more complicated, and manage that complexity yourself, just to satisfy the compiler. It's bad enough that you have to be so explicit about your data structure in C++.
If you really want to do "a bit of a learning thing", research how std::vector does its magic. There are a fair few subtle things in there.
Quote:piece.cpp: In function `void initializeShape()':
piece.cpp:20: error: `tetromino' was not declared in this scope
'initializeShape()' is a free function, not a member function. Therefore, there is no implicit Piece whose .tetromino to work with.
But you're going about this part all wrong, anyway. Set up that data by passing those parameters to the Block constructor, not by calling setPosition. You don't need a setPosition, anyway, if you give the Piece its own position and update that (and take the Block's position as being relative to its containing Piece).
That said, encapsulating individual Blocks is probably overkill for Tetris, and most implementations I've seen (and all the ones I've written) represent a piece with a 4x4 grid of "is there a block at this location relative to the piece location?" instead of a set of 4 "here is the relative location of a block in the piece" values. It makes the rest of the algorithmic work simpler overall. Trust me. ;)