Download as:
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Language:EN
Pages: 4
Words: 562

Centered middle windowgoval ball initball instantiate paddle

// Problem Set 4

//

#include <string.h>

#include <time.h>

// height and width of game's window in pixels

#define HEIGHT 600

#define COLS 10

// radius of ball in pixels

void initBricks(GWindow window);

GOval initBall(GWindow window);

int main(void)

{

// instantiate bricks

initBricks(window);

// instantiate scoreboard, centered in middle of window, just above ball

GLabel label = initScoreboard(window);

// number of points initially

int points = 0;

}

// wait for click before exiting

}

/**

// TODO

}

{

// TODO

*/

GRect initPaddle(GWindow window)

/**

* Instantiates, configures, and returns label for scoreboard.

return NULL;

}

{

// update label

double x = (getWidth(window) - getWidth(label)) / 2;

double y = (getHeight(window) - getHeight(label)) / 2;

* by checking the four corners of its bounding box (which are

* outside the ball's GOval, and so the ball can't collide with

// ball's location

double x = getX(ball);

object = getGObjectAt(window, x, y);

if (object != NULL)

object = getGObjectAt(window, x + 2 * RADIUS, y);

if (object != NULL)

object = getGObjectAt(window, x, y + 2 * RADIUS);

if (object != NULL)

object = getGObjectAt(window, x + 2 * RADIUS, y + 2 * RADIUS);

if (object != NULL)

return NULL;

}

Copyright © 2009-2023 UrgentHomework.com, All right reserved.