Your Sprite
class has a Vector
member that will be constructed when the Sprite
is constructed. At the moment, the Vector
will be initialized with the default constructor because you haven't specified otherwise. If you want a specific constructor of Vector
to be used, you need to add an initialization list to the constructor of Sprite
:
Sprite::Sprite(int x, int y)
: movement(1.0, 0.0)
{
// ...
}
This will initialise movement
with arguments 1
and 0
. In fact, you might as well add other members to your initialization list too:
Sprite::Sprite(int x, int y)
: movement(1.0, 0.0), x(x), y(y), lastX(x), lastY(y) // and so on...
{
// ...
}