![]() | |||||||||||||||||||||||||||||||||||
hmtp sudoku demoJava source filesFlex/Flash source files
This example shows how to create an interactive Flash game using the Caucho BAM architecture. The game we will create is an interactive version of Sudoku in which two players compete on the same board at the same time to fill in the most number of correct squares. Our example application has two main components: the server and the client. The server is constructed in Java while the client is in Flash/Flex. Game layout
<mx:Panel title="Caucho Sudoku" id="panel" width="500"
paddingTop="20" paddingBottom="20" paddingLeft="20" paddingRight="20"
horizontalAlign="center">
<mx:VBox id="layoutBox" horizontalAlign="center">
<sudoku:BoardComponent id="boardComponent"
scoreBoard="{scoreBoard}"
infoLabel="{info}"/>
<mx:Label id="info"/>
<sudoku:ScoreBoard id="scoreBoard"/>
</mx:VBox>
</mx:Panel>
The client's representative on the server: SudokuAvatarThe SudokuAvatar is a BAM agent that represents the player on the server within a certain game. In other words, there is one SudokuAvatar for each player, for each game. The SudokuAvatar is also responsible for routing message from the client agent to the game and vice versa.
| |||||||||||||||||||||||||||||||||||