Hello dear community,
EDIT: Current solution: Using 1-Dimensional vector. Not sure if it will work all the way through. Maybe should have put more time into library specific design.
I saw the spinning card in the projects forum a while back. Now I have to make a memory game, and I immediately thoght about it, and how cool it would be to use it.
I altered the example and achieved an effec exactly what I want it to look like (with a single card, in a single main function).
However, it becomes much more difficult in an object oriented environment:
I have created a class that uses the spinning card classes "Card". (I also used this in my minimal example).
It manages the 2 spinning cards/sprites and provides a 'flip' and 'update' function and also inherits sf::Drawable.
In my Game class I wanted an array<array<Card, 4>, 6>, representing the memory cards. My Problem: There is no suitable default constructor for Card, because there is none for SpinningCard either. So, the compiler complains, and gives an Error C2512:
error C2512: 'std::array<std::array<Card,4>,6>' : no appropriate default constructor available
I don't know how to solve this Problem. I simply can't initialize the cards before loading the sprites and setting their position.
I hope somebody can give me some tips on how to change my design to make it work.
Raincode