31 lines
437 B
C++
31 lines
437 B
C++
#include "ball.hpp"
|
|
#include <iostream>
|
|
|
|
ball::ball()
|
|
{
|
|
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);
|
|
}
|