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.
- 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.
- 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:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started