Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:
image text in transcribed
Player 1 Player2 Playera P262 P3G1 P362 P261 P2G3 P1G1 P1G2 P3G3 P1G3 Player 1 Player2 Playera P262 P3G1 P362 P261 P2G3 P1G1 P1G2 P3G3 P1G3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

How can a firm obtain a unique market position?

Answered: 1 week ago

Question

14 Reliability and validity of selection tests/tools/ methods.

Answered: 1 week ago