BallClass inklusive renderer / Drawfunktion erstellt
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user