Starting from:

$35

Homework 2 “player” and “treasures”

Homework 2 
This assignment is to develop a simple Android board game with a “player” and “treasures”. The
player ‘O’ is placed randomly in a 5x5 board, and the user can move it by clicking on a tile on the board.
The treasure ‘X’ will be periodically generated after the game is started, and there is an upper limit for
the total number of treasures on the board. When the player passes a tile with a treasure, the treasure
will be collected and removed from the board. This homework is expected to be a practice with thread
programming. It is also acceptable if you consider other mechanisms, such as Service, for the
implementation.


Design requirements: (refer to the snapshots above)
1. The game will periodically generate “treasures” (represented by ‘X’) with a fixed interval and an
upper limit. For example, if the interval is 3 seconds and the upper limit is 4, the game will place a
‘X’ randomly on the board every 3 seconds when there are fewer than 4 treasures. When the upper
limit is reached, the game will stop generating new treasures.
2. The user can click on any tile to move the “player” (represented by ‘O’). The player will move along
a path to the target tile. Your app should show a clear movement, i.e., a short pause at the adjacent
tile. Along the path, if the player traverses a tile with a treasure, the treasure will be removed from
the board, and the game should resume to generate treasures following the requirement 1.
3. Two counters need to be maintained, one for the number of tiles the player has traversed, and the
other for the number of treasures the player has collected. 
Reference:
The sample code of HW2_base.zip and threads (CoutingThread.zip and AsyncTask.zip)
Submission:
Export the whole project into a single .zip file and name it as
your_firstname.your_lastname-hw2.zip
And submit it on Blackboard.

More products