Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the following program on Processing: Three playing areas- These are represented by three vertical rectangles of different colours on the screen size of 600
Create the following program on Processing:
- Three playing areas- These are represented by three vertical rectangles of different colours on the screen size of 600 wide x 600 high.
- The shape of the gifts - In this assignment, we are using one shape for all three 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 player's gifts are placed at random locations within the player's playing area. You must use arrays to store the random locations of the gifts. (Hint- use one array per player ).
- Function to display the gifts - Your code must use a function that takes an array as an input/parameter (Hint: you 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 (Hint- validate the random locations of each gift to make sure they don't overlap each other).
- Function to create 'Dice and Roll' operation - Your code must use a function to build a dice and display a random number between 1-6 (inclusive of 6).
- Help Text - Help text is used at the top of the screen, which displays instructions on how to play a game like clicking the dice to start playing or display player names etc. In addition to the above help text, you must display the gift numbers of each respective player's gifts. In the sample video, we have used P1G1, P1G2, P1G3 as the text for three different gifts of Player 1 and P2G1, P2G2, P2G3 for gifts of Player 2 and same for Player 3.
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