205k views
5 votes
1.A three-point polygon that can be moved with four keyboard arrow keys. Color of polygon is blue

2. Trace the path of the top point of the polygon for the last 100 points. Color of tracing path is white
3. A set of rectangles (e.g., 5). Use an array of rectangles to define your rectangle. Changing the size of the array can change the number of rectangles in the game. Draw the rectangles in green color.
4. Initially when the game runs, rectangles move in random directions.
5. When a rectangle collides with any border of the frame (left, right, bottom, top), it is bounced back in the opposite direction.
6. When the polygon is moving, and its top point intersects a rectangle, then the rectangle shall stop and its color changes to red.
7. Background of frame is black

User Seunghun
by
7.2k points

1 Answer

4 votes

Final answer:

The student's question involves creating a simple interactive game with programming elements such as polygons, arrays, collision detection, and movement. It requires understanding of geometry, physics, and computer logic, and may be coded using languages like JavaScript.

Step-by-step explanation:

The question involves creating a simple interactive game using programming concepts such as polygons, arrays, collision detection, and movement within a space. In programming, you would typically use an array to create and manage a set of rectangles. Each rectangle would have properties allowing it to move in random directions, check for collisions with the frame's borders, and respond accordingly by changing direction, mimicking a bouncing effect. The addition of a three-point polygon adds complexity, as you would need to track its position, detect collisions with rectangles, and handle the intersection by stopping the rectangles and altering their color to red. This integrates concepts of geometry, physics principles like velocity and acceleration, and computer logic.

With practice and understanding of coding basics, students can create this game using programming languages like JavaScript in combination with an HTML5 canvas or other game development frameworks. To provide learners a foundation in these concepts, learning resources such as the 'PhET Explorations: Maze Game' or 'Virtual Physics - Forces and Motion-Basics' simulation are excellent starting points.

User Kelsie
by
8.0k points