Hey, so this is something of a beginner question but I'm running into some errors trying to compile the following:
Ball.h
#include<SFML\Graphics.hpp>
class Ball{
Private:
sf::Vector2f Velocity;
sf::Sprite BallSprite;
Public:
Ball(sf::Image &Image);
~Ball();
//void Rebound(sf::Vector2f & Velocity);
};
Ball.cpp
#include"Ball.h"
#include<SFML\Graphics.hpp>
Ball::Ball(sf::Image &Image){
BallSprite.SetImage(Image);
}
Ball::~Ball(){
}
Errors:
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(5): error C2275: 'sf::Vector2f' : illegal use of this type as an expression
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(5): error C2146: syntax error : missing ';' before identifier 'Velocity'
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(8): error C2275: 'sf::Image' : illegal use of this type as an expression
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(8): error C2146: syntax error : missing ')' before identifier 'Image'
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(8): error C2056: illegal expression
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(8): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.cpp(4): error C2511: 'Ball::Ball(sf::Image)' : overloaded member function not found in 'Ball'
1> c:\users\alex\documents\visual studio 2010\projects\breakout\breakout\ball.h(3) : see declaration of 'Ball'
Any ideas why it doesn't like me trying to pass the Vector2f and the Image? The error on Vector2f really confuses me.