This TicTacToe developped by Pablo Requena González using SFML 2.5.2 on Manjaro (Arch Linux).
- Pointers to function or method
I've never done some pointer to functions or method, so I made them is some features in the game.
- AI difficulty:
- Level 0: Random selector.
Level 1: TODO
- Keyboard selection:
- W / Up Arrow : Move up the selector.
- A / Left Arrow : Move left the selector.
- S / Down Arrow : Move down the selector.
- D / Right Arrow: Move right the selector.
- Here is the keybinding:
// All the move* are functions present on the code. KeyToMethod ktom[] = { { sf::Keyboard::W , moveUp }, { sf::Keyboard::A , moveLeft }, { sf::Keyboard::S , moveDown }, { sf::Keyboard::D , moveRight }, { sf::Keyboard::Up , moveUp }, { sf::Keyboard::Left , moveLeft }, { sf::Keyboard::Down , moveDown }, { sf::Keyboard::Right , moveRight }, { sf::Keyboard::Unknown, 0} };
- AI difficulty:
- .vscode: VSCode files.
- githubResource: This is a folder with some images to this README.
- inc: Header files used on the game.
- src: Source files used on the game.
- res: Resource folder, this folder has all images used on the game.
- main.cpp: Main of the game.
- Makefile: Compilation file.
Thanks to make, we can compile the code using a terminal.
- Install dependencies
yaourt sfml
on my case, in other case, just look on SFML Installation WebSide (Linux on this link, but it is possible to install it on several S.O. - Clone this repository
git clone https://github.com/parequena/TicTacToe.git
- Then insert into the project path
cd TicTacToe
- Compile using Makefile
make
- Execute the game calling the output file
./exe
- Play the game.
Menu
Board, both Tokens and Human Selector
Board, both Tokens and Human Selector
AI Selector
- Robot image: https://emojiisland.com/products/robot-iphone-emoji-jpg
- Font: https://www.dafont.com/es/lemon-milk.font
If you want to get in touch with me, here are my social networks