Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ochess
#1
greetings,

i needed to write some sort of sample for drv and my gamelib ( basically fbgfxlib rip of + homebrew networklibrary ) so i thought a networked chess would be nice

http://ratatoskr.dragonhill.cc/temp/chess.rar

that's what i got after 2 nights of coding. it's missing the check for the check mate condition ( but it has a check for the check condition, if a move of you would put your king in check it's not allowed -> you can't move ). it also misses rochad and the "get your pawn at the end of the board and win a free queen" thingy.

other than that it has local player mode ( 2 ppl on one pc ) and multiplayer mode, where one has to be the server and the other one the client.

you will get prompted at the beginning what mode you want to play int

+ l for local mode ( 2 players on the same pc )
+ s for server mode ( will wait until a client connects )
+ c for client mode ( will try to connect to a server at the ip you pass it )

the server is always white, the client black. you can see who's turn it is in the bottom left corner. to move your pieces click on it and it well get marked red. next click where you want to move your unit. drag and drop is NOT implemented ( might be in the next version due to popular demand... )

any bug reports appreciated
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#2
small update:

everything except the checkmate check is implemented now, that is:

+ normal movement
+ "get pawn to other side of board and win free queen" move
+ castling
+ check check

the only thing missing to make it a complete thingy is a checkmate check. gonna do that tomorrow i guess, it's a pain in the ass ( well not really but me's lazy ... )

still, bug reports appreciated
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#3
Checkmate is just a detailed thing to look for, not terribly difficult really. Smile You simply compare the king's surrounding positions and see if they're safe. If one is, then there's no checkmate. Smile
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#4
sadly it's not that easy :p you can also beat offending units, or block their way leaving me with having to check every possible position of every unit of the side that is possibly in checkmate. of course that's not difficult either i'm just lazy :p
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#5
There shold be a way to detect if there are other people on the server. I connected and waited, but I guess there wasn't anyone else on the server.
Reply
#6
oh i didn't make that clear i think :p you can either be a server ( that is listen for ONE incoming connection if that arrives the game will start ) or connect to one of those listening servers. there's no lobby system or anything the like in there.
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)