You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
674 B
C++

#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
namespace Proto4 {
class Player : public sf::CircleShape {
sf::Vector2f speed {0.f, 0.f};
const float acceleration = 2500;
const float deceleration = 3;
const float maxSpeed = 850;
const float maxRotationSpeed = 800;
sf::Vector2f keyboard2Acceleration();
void updateSpeed(float timeStep, sf::Vector2f acceleration);
void updateRotation(float timeStep, sf::Vector2f mousePos);
public:
Player();
void update(sf::Time timeStep, sf::Vector2f mousePosition);
void reset();
};
}