BallClass inklusive renderer / Drawfunktion erstellt

This commit is contained in:
2025-10-18 14:24:24 +02:00
parent 860d8febe6
commit 0e29919fd2
7 changed files with 93 additions and 10 deletions

View File

@@ -1,11 +1,30 @@
#include "ball.hpp"
#include <iostream>
ball::ball()
{
x = 0;
y = 0;
std::cout << "Ball erzeugt!"<< std::endl;
x = 50;
y = 50;
rect = {20,20,20,20};
color = {0,255,0,255};
}
ball::~ball()
{
}
int ball::GetXPos(){
return x;
}
int ball::GetYPos(){
return y;
}
void ball::Draw(SDL_Renderer* renderer){
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a);
SDL_RenderFillRect(renderer, &rect);
}