Upload files to "/"
This commit is contained in:
parent
3473670f67
commit
c898dd8996
4 changed files with 147 additions and 0 deletions
31
player.hpp
Normal file
31
player.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
//float velocityY;
|
||||
//float gravity;
|
||||
//float jumpStrength;
|
||||
//bool isOnGround;
|
||||
|
||||
|
||||
class Player {
|
||||
|
||||
private:
|
||||
sf::RectangleShape shape; // форма гравця
|
||||
float speed; //швидкість гравця
|
||||
float velocityY; // швидкість по вертикалі
|
||||
float jumpStrength; // сила стрибка
|
||||
bool onGround; //чи стоїть на землі
|
||||
float gravity; // сила гравітації
|
||||
float groundLevel; // висота "землі"
|
||||
|
||||
|
||||
|
||||
public:
|
||||
Player(); // порожній конструктор
|
||||
void update(float deltaTime);
|
||||
|
||||
void draw(sf::RenderWindow& window);
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue