Question: Create a program in processing (inspired by Java). The ellipse will reveal a pattern of rupees in the shape of a heart. The position of
Create a program in processing (inspired by Java).
The ellipse will reveal a pattern of rupees in the shape of a heart. The position of the rupees is set from the start but they are hidden until the ellipse walks/swims over them. You should store a number of arrays to represent the x position, y position and status (hidden or revealed) of each rupee. When the program starts, the rupees are all hidden in a heart pattern. As the ellipse walks over a hidden rupee, it becomes visible. That rupee will stay visible if the ellipse walks over it again at any point. The ellipse over the rupees, not under them.
The ellipse is controlled by WASD keys. Here is the partial code to help you complete the program.
void setup() { size( 810, 810 );
----------------------
void keyPressed() { if ( key == 'w' ) { speed.y = -1; speed.x = 0; } else if ( key == 's' ) { speed.y = 1; speed.x = 0; } else if ( key == 'a' ) { speed.x = -1; speed.y = 0; } else if ( key == 'd' ) { speed.x = 1; speed.y = 0; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
