OpenSceneGraph Introduction:
OpenSceneGraph (hereinafter referred to as OSG) is an open-source three-dimensional engine, is widely used in visual simulation, gaming, virtual reality, scientific computing, three-dimensional reconstruction, geographical information, space exploration, oil and minerals and other fields. OSG is written in standard C + + and OpenGL and runs on all Windows platforms, OSX, Gnu/linux, IRIX, Solaris, HP-UX, AIX, Android and FreeBSD operating systems.
More information about OSG: http://www.openscenegraph.org/
Game General rules:
Quint Card is a Nordic style for the background of the turn-based card game. Each game by two players to play, the outcome of the decision method is 3 innings 2 wins, first win 2 innings of the player wins. The player starts by randomly extracting 10 cards from the card group. Different from the general card game is not only rely on a few effect cards and group effects outside the player is not able to extract new cards, that is, all the 2-3 small game players only 10 cards can be used, the card used in the next small bureau can not be used again and no new card supplement.
Unit cards are divided into 3 categories, melee, ranged and siege. Each class occupies a horizontal. At the end of a small game, the total attack strength is added, and the big side wins. In a small game, the two sides take turns out of cards, one at a time, until one party does not have a card or actively press the space bar to end the card when the end of a small innings and start clearing power points. Weather cards can affect the same kind of units on both sides.
For detailed rules see:
Http://witcher.wikia.com/wiki/Gwent
Design of the class:
Director is responsible for controlling game logic and behavior, with two player objects
The player is responsible for controlling the behavior of a player in a game, and the player input is detected by the Pickhandler and given the corresponding signal to the other player response
P2callback is a response object whose operator method is called once per frame for animation effects and network messaging.
Datarecieverthread is a thread that is used to receive network messages.
Deck, GARABGE, hand are three cardstack sub-classes, Cardstack is a card stack.
Field subordinate four Cardstack:weather, Meele, Archer, siege.
These several cardstack are distributed in the game as follows:
The control flow of the game is as follows:
Interface design:
The client login must enter the server IP address, the login interface is as follows:
After entering the correct server IP, you can connect and select the room, if the room is full will be prompted by the "fully", if forced entry will be kicked out of the server:
After entering the room, wait for all two players to enter and then start the game:
Quint Card online--Client Design