Please post your code in [code=cpp] [/code] tags.
You probably want MoveLeft to set the velocity to a negative value thus:
void Player::MoveLeft() {
velocity.x = -speed;
}
Please post your code in [code=cpp] [/code] tags.
You probably want MoveLeft to set the velocity to a negative value thus:
void Player::MoveLeft() {
velocity.x = -speed;
}
How can I do that?
Please post your code in [code=cpp] [/code] tags.
You probably want MoveLeft to set the velocity to a negative value thus:
void Player::MoveLeft() {
velocity.x = -speed;
}
Yes, that was an error However that still did not solve my problem that once I press any key my sprite moves but when I release the key the sprite doesnt stop, it keeps going in that direction.