___ _ _ _ ___ _
( _`\ ( )_ ( )_ (_ ) ( _`\ ( )
| (_) ) _ _ | ,_)| ,_) | | __ | ( (_)| |__ __ ___ ___
| _ <' /'_` )| | | | | | /'__`\| | _ | _ `\ /'__`\/',__)/',__)
| (_) )( (_| || |_ | |_ | | ( ___/| (_( )| | | |( ___/\__, \\__, \
(____/'`\__,_)`\__)`\__)(___)`\____)(____/'(_) (_)`\____)(____/(____/
python battleChess.py
git clone https://github.com/quimnuss/battlechess.git
On a regular afternoon break at CVLab, a discussion was about to wake us (Pol, Raphael, Pen and Antoine) from our boredom. "Chess, to brainy. BattleShip, lack some action... But wait, what if we mixed both ?" BattleChess was born. Mixing rules from both games to make a new exciting one.
The rules are pretty straithforward for anyone who played chess before. The board and pieces are the same. They move and capture opponents the same way. The main difference arise from the fact that at a given time each player can only see the part of the board he actually controls. That's all his pieces positions and direct neighbooring cells. No more, no less. That new rule has some direct consequences on the gameplay.
What you need :
git clone http://git.sxbn.org/battleChess.git
Launching the game :
There is and will be a server app running on sxbn.org, so I recommend no changing the HOST and PORT parameters unless you want to host your own games.
In the root directory ( battleChess/ ), you can directly launch the game using the command
python battleChess.py [NickName] [HOST] [PORT]
with 3 optional parameters :
Replay mode :
You just got beaten and you don't know what just happened. Don't worry that happens a lot. Every game played are saved on the server and can be downloaded from this webpage : http://sxbn.org/~antoine/games/
You can either download the file or replay it from the url directly using one of the following commands :
python battleChess.py -p http://sxbn.org/~antoine/games/2014_03_07_14_06_37_lance_hardwood_Vs_sniper.txt
python battleChess.py -p ./2014_03_07_14_06_37_lance_hardwood_Vs_sniper.txt
Using the server application :
If you want to host your own server (you don't have to). You just need to run the api with
$ uvicorn server.btchApi:app --reload
program on a computer that can be reached through the network. Change the port and hostname if you want and pass those informations to the client application. Check $ uvicorn --help
.
You'll need to install the packages listed in requirements.txt
. You can do so with $ pip install -r requirements.txt
You can go to localhost:8000/docs
for the documentation and usage examples. Create a user and then authenticate on the upper right with johndoe
and secret
Information sent on the network : If you worry about privacy, you can launch your own server. It's pretty straigthforward to see from the source code that nothing is sent anywhere else. The only information sent and stored on the server are your nickname and the moves you make.
Tests:
You can use the $ pytest
runner to run the tests from the root of the project.
Regular game : White play first. To move a piece, click on it and then click on the desired destination. Your piece will move there, if it can. You know it's your turn to move when the message on the top left says your color. You can exit the game anytime with ESCAPE.
Replay mode : Use LEFT and RIGHT arrows to move step by step (and loop) into the game. SPACE will reset to initial state.
Android .apk file can be downloaded from this link : http://sxbn.org/~antoine/git/battlechess/BattleChess.apk
iOS app is ready and working, but thanks to Apple's App Store terms we cannot release it without paying...
If you are builind the app from source and it complains that cocos2dx doesn't have neon_matrix_impl.c, copy it from cocos2dmods/ to the directory where it is looking for it.
Code : Antoine Letouzey -- antoine.letouzey@gmail.com Pol Monsó-Purtí -- pol.monso@gmail.com
Sprites : Original sprites by Wikipedia user Cburnett, under Creative Commons Licence (CC BY-SA 3.0)
Licence : GPL