added player class to simplify player creation, need to make it a child of a rect so that way I can make groups of all elements

This commit is contained in:
DarthMooMancer
2025-10-15 20:42:26 -04:00
parent c0377bb9f9
commit 399ccc8617
5 changed files with 104 additions and 31 deletions
+5
View File
@@ -0,0 +1,5 @@
#ifndef GLOBALS_HPP
#define GLOBALS_HPP
#define WIDTH 600
#define HEIGHT 400
#endif
+23
View File
@@ -0,0 +1,23 @@
#ifndef PLAYER_HPP
#define PLAYER_HPP
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/System/Vector2.hpp>
class Player {
public:
Player(sf::Vector2<float> size, sf::Vector2<float> starting_position, float acceleration, float initial_acceleration, float thickness, float velocity_x);
sf::RectangleShape rect;
sf::Vector2<float> m_size;
sf::Vector2<float> m_velocity;
float m_acceleration;
float m_jump_strength;
float m_thickness;
bool m_jumping;
sf::Vector2<float> get_velocity();
bool get_jumping();
// private:
};
#endif