I’m new to both C++ and SFML and am trying to learn both. Reading Chapter 1 of
SFML Game Development by Moreira, Hansson and Haller and moving the red circle around the SFML screen reminded me of a game we used to play on graph paper before we had personal computers. So this is a modified version of that game. It’s basically a learning exercise, but it’s turned out to be a lot of fun.
To see screenshots of the game, click here
http://rhloring.wix.com/utilitypageThe attachments contain the code, an executable file compiled for PC, and a data file (bestgamedata.txt) for a sample game. The executable file requires sansation.tff, the bestgamedata.txt file and the sfml-graphics, system and window dll’s to run.
Some future SFML enhancements that I’d like to try:
• Setting up a touch pad for move entry
• Adding sounds to the moves
• It is possible to play this game with two players, so a network version would be fun to try.
• Setting up a timer (and pause) to limit the time allowed for each move.
• Two graphics problems: Sometimes it’s hard to see whether a possible move causes the player to miss a gate AND it’s apparently not possible to get the future move circles perfectly aligned around the grid points at single pixel resolution. One possible solution to both problems is to set up the course at a higher resolution, and then use SFML View and Zoom to allow seeing either the whole course with correct alignment or conversely, see a close up of a gate.
Some future C++ enhancements I’d like to try:
• Setting up a player class that would include past moves and future moves and move vectors
• Setting a gate class that includes the gate vectors
• Learning how to use game states instead of Boolean flags to control the flow of the game (covered in part in
SFML Game Development).
• Playing against an AI opponent, but this might be a hard nut to crack
I’d love to get people’s feedback and ideas on how to proceed.
For more information about the original game, see
http://en.wikipedia.org/wiki/Racetrack_(game) .