CTEC1903 Computer Programming.

Publish By: Admin,
Last Updated: 15-Sep-23
Price: $120

The coursework is about writing a simple game.This explanation sheet will help you to better understand the required functionality. Some features are more advanced, and it is expected you will attempt to complete as much of the game as possible. The mark you receive will be based upon how many unit tests you pass - the tests are designed to assess that the features work correctly.

You have been given a class Game, which consists of a field of size 10x10. The field is numbered as follows:

                                x

                                0              1              2              3              4              5              6              7              8              9

Y              0              p             .               w            .               .               .               .               .               .               .

1              .               .               w            .               .               .               .               .               .               .

2              .               .               w            .               .               .               .               .               .               .

3              .               b             .               .               .               .               .               .               .               .

4              .               .               .               .               .               .               .               .               .               .

5              .               .               .               .               .               .               .               .               .               .

6              .               .               .               .               .               .               .               .               .               .

7              .               .               .               .               .               .               .               .               .               .

8              .               .               .               .               .               .               .               .               .               .

9              .               .               .               .               .               .               .               .               .               .

The grid above should help you to visualise this scenario, and we have used p to show the current player position and w to show a wall. Coordinates are given as pairs in the form (x,y). Although different conventions can be used, here we define the origin as being in the upper left corner (which is common in computer graphics). Moving in the x direction would go right (or left) and moving in the y direction would go down (or up).

Therefore, in the snapshot shown above, the player is positioned in (0,0) at the origin.In the Game class you have been provided, the current position of the player is stored in positionX and positionY.