23Spring CS109 Project Specifications

Jungle

Introduction

Jungle or Dou Shou Qi (斗兽棋), is a modern Chinese board game with an obscure history, as shown in the Figure 1. The game is played on a 7×9 board and is popular with children in the Far East. Jungle is a two-player strategy game and has been cited by The Playboy Winner's Guide to Board Games as resembling the Western game Stratego.

筘1703105484

Pieces

 

Figure 1. Jungle Chess Game

Each player owns 8 animal pieces representing different animals of various ranks, and higher ranked animals can capture the animals of lower or equal rank. But there is a special case that eleplant cannot capture the rat while the rat can capture the eleplant.

Rank

Piece

Special Movement

8

Elephant(象, xiàng)

/

7

Lion(狮, shj)

Jumping across the river

6

Tiger(虎, hǔ)

5

Leopard(豹, bào)

/

4

Wolf(狼, láng)

/

3

Dog(狗, gǒu)

/

2

Cat(猫, māo)

/

1

Rat(鼠, shǔ)

Entering the river

Table 1. Ranks of eight pieces (Eleplant>Lion>Tiger>Leopard>Wolf>Dog>Cat>Rat)

Each player moves alternatively, and all pieces can move one square horizontally or vertically, but not diagonally. As shown in the table, there are some special movements for lion, tiger and rat. These will be explained in detail:

  1. Entering the river:
    • The rat is the only animal that may go onto a water square.
    • After entering the river, the rat cannot be captured by any piece on land.

    • Also, the rat in river cannot capture the eleplant on the land.

Left: Figure 2; Right: Figure 3.

Red rat can move to the square in green and cannot move to the square in red.

  1. Jumping across the river:
    • The lion and tiger can jump over a river vertically or horizonally. They jump from a square on one edge of the river to the next non-water square on the other side.
    • If that square contains an enemy piece of equal or lower rank, the lion or tiger capture it as part of their jump.
    • However, a jumping move is blocked (not permitted) if a rat of either color currently occupies any of the intervening water squares.

Left: Figure 4; Right: Figure 5.

Red lion can move to the square in green in Figure 4; Red tiger can move to the square in green but cannot move to the square in red in Figure 5.

Chessboard

Jungle game has an interesting chessboard with differerent terrains including dens, traps and rivers. After the initialization, the pieces start on squares with pictures corresponding to their animals, which are invariably shown on the Jungle board.

ure 6. Initial State of Jungle The three kinds of special terrains are explained as:

  1. Dens(兽穴): It is not allowed that the piece enters its own den. If the player's piece enters the dens of his/her opponent, then the player wins,.
  2. Trap(陷阱): If a piece entering the opponents's trap, then its rank is reduced into 0 temporarily before exiting. The trapped piece could be captured by any pieces of the defensing side.
  3. River(河流): They are located in the center of the chessboard, each comprising 6 squares in a 2×3 rectangle. Only rats could enter the river, and lions and tigers could jump across the river.

Rules

  1. Game Initialization: At the beginning, all 16 pieces are put into the chessboard as the initial state. The initial state is shown in Figure 6.
  2. Game Progress: The player with blue moves first. Two players take the turn alternatively until the game is finished. When a player takes turn, he/she can select one of his pieces and do one of the following:
    1. Moving one square horizontally or vertically. For lion, tiger and rat, they also have special movements related to the river squares, which have been introduced previously.
    2. Capturing an opposing piece. In all captures, the captured pieces is removed from the board and the square is occupied by the capturing piece. A piece can capture any enemy piece following the rules introduced in "Pieces".
  3. Game Termination: A player loses the game if one of the following happens:
    1. The den is entered by his/her opponents.
    2. All of his/her pieces are captured and he/her is unable to do any movement.

Project Requirements

Task 1: Game Initialization (10 pts)

    1. Your program should be able to initialize a new chess

game, with the board elements displayed correctly, including board size, terrain types, quant ities and locations, and pieces types, quantities and locations.

    1. Your program should be able to display

the game state correctly, including the number of rounds and the current player. The terrain and pieces of both sides should be distinguished.

    1. Your program should be able to restart by clicking a button instead of closing it and repoening the game

again. The board elements and game state are displayed correctly after reset.

Task 2: Saving/Loading a Game (20 pts)

    1. Your program should be able to load an existing game from a text file with a pre-defined format by clicking buttons. After loading, all piece should be placed at the positions given in the text file. The file saving the game should include at least the current chessboard, the previous moves and the current side to play (red or blue).
    2. Your program should be able to save the current game into a text file.
    3. Your program should be able to perform error checking of saves can be done, such as any move is invalid, chessboard size is incorrect e.t.c.

Task 3: Game Play (40 pts)

    1. Your program should detect the winning status of the game, and end the game when there is a winner.
    2. Your program should allow pieces to move according to the terrains and rules, including some special rules of rats, tigers and lions.

Task 4: Graphical Interface (10 pts)

    1. Your program should have a graphical user interface using Java Swing.
      • JavaFX is acceptable, but it is not allowed to use WebView in JavaFX and implement the GUI with HTML+CSS+JavaScript. You are required to use Java to implement the drawing logic of the interface instead of web programming.

Task 5: Advanced Requirements (20/30 pts)

If your program meets all the above basic requirements, you will get 80 points. The remaining 20/30 points will be given if you achieve the advanced requirements. You are highly encouraged to go beyond our requirements. Below are some possible ways to get the 20/30 points. Here you need to rely on your own ability to present your programming charm!

    1. Design a platform for your game, such as adding multi-user, ranking list, adding start menu for selecting the game modes, etc.

    1. Make your game looks nicer, such as using beautiful images as chessboard, changing the theme, adding sound effect, adding background music, adding more prompt label when the game is in process.
    2. Show possible moves when a piece is selected.
    3. Play the process of moving, capturing, and flipping pieces after loading the save file.
    4. Undo one previous move or multiple previous moves.
    5. Support online mode in Local Area Network.
    6. Pack the game as an executable that can be executed on a computer without JRE.
    7. Design Human vs. AI mode of different difficulty levels, and make the AI player smarter.
    8. More...

During project evaluation, your advanced implementations will be evaluated according to their difficulty and novelty, and graded into A/B/C/D class, i.e., 12/8/4/2 points, respectively. Points granted from the same class by multiple advanced functions can stack. All advanced implementations count towards the points for task 5 you can get. The advanced part is capped at 30 points if your project is demonstrated on the Week 15's labs, and capped at 20 points if it is on the Week 16's labs. The total grade of project part cannot exceed 100 points.

Notes

  1. If you have any questions about the rules of Jungle, please do ask the instructors. If your program does not match the rules, we may deduct some points from your final project grade.
  2. Please start the project as early as possible. Do not leave the project to the last minute.
  3. Please form your team as early as possible.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值