MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / initializeHappyFaces

Function initializeHappyFaces

deps/SDL2/Xcode-iOS/Demos/src/happy.c:25–39  ·  view source on GitHub ↗

Sets initial positions and velocities of happyfaces units of velocity are pixels per millesecond */

Source from the content-addressed store, hash-verified

23 units of velocity are pixels per millesecond
24*/
25void
26initializeHappyFaces(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
41void
42render(SDL_Renderer *renderer, double deltaTime)

Callers 1

mainFunction · 0.85

Calls 2

SDL_RenderGetLogicalSizeFunction · 0.85
randomFloatFunction · 0.85

Tested by

no test coverage detected