Sets initial positions and velocities of happyfaces units of velocity are pixels per millesecond */
| 23 | units of velocity are pixels per millesecond |
| 24 | */ |
| 25 | void |
| 26 | initializeHappyFaces(SDL_Renderer *renderer) |
| 27 | { |
| 28 | int i; |
| 29 | int w; |
| 30 | int h; |
| 31 | SDL_RenderGetLogicalSize(renderer, &w, &h); |
| 32 | |
| 33 | for (i = 0; i < NUM_HAPPY_FACES; i++) { |
| 34 | faces[i].x = randomFloat(0.0f, w - HAPPY_FACE_SIZE); |
| 35 | faces[i].y = randomFloat(0.0f, h - HAPPY_FACE_SIZE); |
| 36 | faces[i].xvel = randomFloat(-60.0f, 60.0f); |
| 37 | faces[i].yvel = randomFloat(-60.0f, 60.0f); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | void |
| 42 | render(SDL_Renderer *renderer, double deltaTime) |
no test coverage detected