In the memory game, a large right hand gives you a demo of the drum order for the round.

Work continues on my water drumming game. I’ve been learning a lot by creating this game, which was outside of the scope and tutorials found in my beginner C++ class. I’m pretty sure that my code looks as ugly as the artwork, but it is functional, which is a great feeling!

One error that I ran into confused me for a bit:

DrumGame.cpp:130:5: error: ‘string’ was not declared in this scope
string demoMode = “”;

But I have used string before and had no issues. Specifically, it came down to the fact that I’m using sfml. For some reason, there is a sf::String, and std::string. Notice the capitalization. According to SFML’s documentation:

Utility string class that automatically handles conversions between types and encodings.

sf::String is a utility string class defined mainly for convenience.

It is a Unicode string (implemented using UTF-32), thus it can store any character in the world (European, Chinese, Arabic, Hebrew, etc.).

It automatically handles conversions from/to ANSI and wide strings, so that you can work with standard string classes and still be compatible with functions taking a sf::String.

So, you either need to use String, so you can use SFML’s String, or you need to append std:: to the front of string so you can used the standard string.

Either way, the latest commit is up, where you can select “memory” from the menu, and it will demonstrate the pattern you need to repeat. Right now, since you can’t play back the pattern by clicking, it only shows you the pattern of one. The idea is once you complete that pattern, it adds another drum to your pattern for you to play next.

Stay tuned for part 2 where I will *hopefully* finish the memory mode.

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *