4 * Created on: Apr 9, 2012
13 #include <SDL/SDL_gfxPrimitives.h>
20 Ball::Ball(Scalar radius)
26 Ball::Ball(const Vector &position, Scalar radius)
27 : Entity(position, &shape)
28 , shape(position, radius) {
33 void Ball::Collide(Entity &other, const Vector &normal) {
34 Entity::Collide(other, normal);
36 if (dynamic_cast<Paddle *>(&other)) {
41 void Ball::Render(SDL_Surface *screen) {
42 circleRGBA(screen, shape.X(), shape.Y(), shape.Radius(), 0xFF, 0xFF, 0xFF, 0xFF);