Question: Need help programing this in C please. hitbox - perform collision detection 1 V/Do not change the definition of this data type The following struct
Need help programing this in C please.

hitbox - perform collision detection 1 V/Do not change the definition of this data type The following struct data type represents the position and size of a rectangle in the x/y coordinate plane 2 struct Rect 4 6 8 I/ TODO: implement the hitbox function as described double x, y; double width; double height; struct Rect double x, y; double width; double height; di 9 The x and y fields are the coordinates of a reference point. The width field indicates the width of the rectangle, such that the rectangle's range of x coordinate values spans from x to x+width. The height field indicates the height of the rectangle, such that the rectangle's range of y coordinate values spans from y to y+height Your task is to implement a function called hitbox. This function takes two parameters, each of which is an instance of struct Rect. It returns a double value, which represents the area of the region of overlap between the two rectangles. If the rectangles do not overlap, the function should return 0 (zero) You may define other functions (i.e., as helper functions), as long as the hitbox function is implemented as described Author: David Hovemeyer License: Creative Commons Attribution-ShareAlike 3.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
