Hi all. I’m new to FlashPunk and trying to get my head around The FlashPunk Way here.
I’m working on a Tetris-style game, and I’m having trouble figuring out how to use the Entity class.
I imagined I could make an Entity composed of other Entities (e.g., in Tetris, a Piece
could be composed of multiple Block
s), but it doesn’t seem Entities can contain other Entities. Is that right?
I then just figured I’d just redraw my Piece
Entity each time I needed to (e.g., when you rotate the piece) using blocks as graphics. However, I’m not really finding a good way to redraw an Entity either, other than using a sprite-sheet. And putting all the rotations of all the possible pieces in a sprite-sheet seems pretty cumbersome compared to just arranging the blocks in code.
Because the falling piece is not a character or static object but rather a kind of amorphous and changing group of blocks, I’m not sure how to set it up in the context of FlashPunk.
Any thoughts? Is an Entity the right way to go for this, or am I missing something else?
Cheers and thanks! Scott