SFML community forums

General => SFML projects => Topic started by: zmertens on April 26, 2014, 11:36:42 am

Title: Checkers ( work in progress )
Post by: zmertens on April 26, 2014, 11:36:42 am
Hello all, I've been lurking here a couple months, and I wanted to share my Checkers project I've been working on which uses the SFML library.

I'm still learning the ropes of C++ and SFML. This project was originally from a school assignment and I have expanded upon it by adding the GUI and some other features.

New link!: https://github.com/zmertens/Checkers/releases

http://youtu.be/UBzWI9Z8_IM

P.S.: I used Visual Studio 2012 Professional as my IDE. I notice that the project runs ultra slow in Debug mode, but if I run it without debugging it runs fine. Is that normal?
Title: Re: Checkers ( work in progress )
Post by: Nexus on April 26, 2014, 11:44:41 am
P.S.: I used Visual Studio 2012 Professional as my IDE. I notice that the project runs ultra slow in Debug mode, but if I run it without debugging it runs fine. Is that normal?
It depends on what you're doing. Typically, code that uses the STL intensely runs slow in Debug mode, because a lot of additional checks (indices, iterators, memory, ...) are performed.

If you're concerned about performance, you should measure with a profiler in Release mode. You can then find out which parts of the code consume the most time.
Title: Re: Checkers ( work in progress )
Post by: zmertens on May 13, 2014, 10:26:46 am
I made some more changes to this project. First, the AI works for human verses computer (I still haven't added a computer verses computer yet). However, it isn't completely debugged at the moment. It still seems to work 90% of the time though. The algorithm basically picks the first available jump for a checker in the player's vector, or the first available move if a jump isn't available. But the AI won't conduct a double jump right now.

I'm also using some sound effect files from CirrusMinor's WitchBlast game (I added a reference to the README on Github). The sound effects trigger when a move, jump, or king occurs.

I also added file saving for the game times. Nothing too fancy though, and the game times only show on console at the moment.

My next goals are to make the main screen more attractive. I want to have an animation of sorts in the bottom half of the window showing a checker game in progress. And the menu selections will be on the top half. I also need to fix how the window resizes. I need to play around with sf::View class. Right now the best way to resize the window is by modifying the "Global.hpp" header file manually (the default is 1000 x 1000).

Anyway, here's an updated video of some gameplay!
http://youtu.be/cz4HIUea2ME