Question: create 2D game which has the following components: 1. Three playing areas - These are represented by three vertical rectangles of different colours on the

create 2D game which has the following components:

1. Three playing areas- These are represented by three vertical rectangles of different colours on the screen size of 600 wide x 600 high. In the video, these three vertical rectangles are filled with red, purple, and green colours. Though the players playing area is represented as three vertical rectangles.

  1. The shape of the gifts: use a rectangle (round corner) as a shape for the gifts. Player 1 gifts are filled with green colour, Player 2 gifts are filled with yellow colour and Player 3 gifts are filled with purple colour.
  2. Position of the gifts- Each players gifts are placed at random locations within the players playing area. must use arrays to store the random locations of the gifts. (use one array per player).

4. Function to display the gifts the code must use a function that takes an array as an input/parameter (pass the array which stores the random location of the gift from step 3 above). The function iterate through the input array to draw the gift/shapes on the respective players playing area. No two gifts should overlap each other (validate the random locations of each gift to make sure they dont overlap each other).

5. Function to create Dice and Roll operation the code must use a function to create a dice and display a random number between 1-6 (inclusive of 6).

the image below is sample:
 create 2D game which has the following components: 1. Three playing

Player 1 Player2 Playera P262 P3G1 P362 P261 P2G3 P1G1 P1G2 P3G3 P1G3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!