Question: C++ SDL2 Hello everyone, I need to create the first draft of the AT-Robots game. I need to create a gray arena with black borders

C++ SDL2

Hello everyone, I need to create the first draft of the AT-Robots game. I need to create a gray arena with black borders and with columns and rows on the right side which will containt three rectangles per each row with the information about the robots, like: health, name and color. For now I just need to design the arena with columns and rows with some random colors, names and health percentage. Here is a sample of how it should look like and here is my code so far.

C++ SDL2 Hello everyone, I need to create the first draft of

const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main(int argc, char* argv[]) { SDL_Window* window = NULL; SDL_Renderer* renderer = NULL; SDL_Surface* screenSurface = NULL;

if (SDL_Init(SDL_INIT_VIDEO) format,0,0,0)); arect.x=14; arect.y=14; arect.w=SCREEN_WIDTH-28; arect.h=SCREEN_HEIGHT-18; SDL_FillRect(screenSurface,&arect,SDL_MapRGB(screenSurface->format,128,128,128)); SDL_RenderClear(renderer);

SDL_SetRenderDrawColor(renderer, 66, 134, 244, SDL_ALPHA_OPAQUE); SDL_RenderDrawLine(renderer, 320, 200, 300, 240); SDL_RenderDrawLine(renderer, 300, 240, 340, 240); SDL_RenderDrawLine(renderer, 340, 240, 320, 200); SDL_RenderPresent(renderer);

SDL_UpdateWindowSurface(window); SDL_Delay(3000); }

} SDL_DestroyWindow(window); SDL_Quit(); return 0; }

Robot 1 Robot 2 Robot 3 Robot 4. 25% 41% 58% 99%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!