diff --git a/src/render.c b/src/render.c index 9a34d45..700abdb 100644 --- a/src/render.c +++ b/src/render.c @@ -13,67 +13,61 @@ void renderGame(){ SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); -//Head__________________________________________________ - SDL_SetRenderDrawColor(renderer, 0, 200, 100, 255); //RGB-Farbe Kopf - SDL_Rect rect; - rect.x = (game.snake.headX * config.blockSizePx); //Abstand links - rect.y = (game.snake.headY * config.blockSizePx); //Abstand rechts - rect.w = config.blockSizePx; - rect.h = config.blockSizePx; + SDL_Rect rect; //Rechteck anlegen + rect.w = config.blockSizePx; //Breite festlegen + rect.h = config.blockSizePx; //Höhe festlegen - SDL_RenderFillRect(renderer, &rect); //Rechteck rendern +//_______Head kreieren__________________________________________________ + SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); //RGB-Farbe Kopf + rect.x = (game.snake.headX * config.blockSizePx); //Abstand links + rect.y = (game.snake.headY * config.blockSizePx); //Abstand rechts + SDL_RenderFillRect(renderer, &rect); //Rechteck rendern - //Snake-Baustein kreieren_________________________________________________________________ - for(int i = 1; i>game.snake.length; i++){ - SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); //RGB-Farbe Tail - - SDL_Rect rect; +//______Tail kreieren_________________________________________________________________ + for(int i = 1; i