fix to player velocity

This commit is contained in:
DarthMooMancer
2025-10-15 22:04:19 -04:00
parent fae17aac92
commit c77b350de6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ int main() {
sf::RenderWindow window(sf::VideoMode({WIDTH, HEIGHT}), "SFML window", sf::Style::Default);
window.setFramerateLimit(60);
Player player { { 16.0f, 16.0f}, { 40, 40}, 1.0f, 20.0f, 2.0f, 2.5 };
Player player { { 16.0f, 16.0f}, { 40, 40}, 1.0f, 20.0f, 2.0f, 4 };
player.rect.setFillColor(sf::Color::Black);
player.rect.setOutlineColor(sf::Color::White);
+1 -1
View File
@@ -16,7 +16,7 @@ void Player::handle_movment() {
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::D)) {
rect.move({m_velocity.x, 0});
} if(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::A)) {
rect.move({m_velocity.x, 0});
rect.move({-m_velocity.x, 0});
}
// if(sf::Keyboard::isKeyPressed(sf::Keyboard::Key::W)) {
// rect.move({0, -2.5});