mini optimization to make making entities easier
This commit is contained in:
+6
-2
@@ -12,16 +12,20 @@
|
||||
*
|
||||
* */
|
||||
|
||||
Player::Player(sf::Vector2<float> size, sf::Vector2<float> starting_position, float acceleration, float initial_acceleration, float thickness, float velocity_x, sf::Color inside_color, sf::Color border_color) {
|
||||
|
||||
Entity::Entity(sf::Vector2<float> size, sf::Vector2<float> starting_position, float thickness, sf::Color inside_color, sf::Color border_color) {
|
||||
rect.setSize(size);
|
||||
rect.setPosition(starting_position);
|
||||
rect.setOutlineThickness(thickness); // Needs to be the same as floor height to be properly on the line; else it will just show up above the line or in the line
|
||||
rect.setFillColor(inside_color);
|
||||
rect.setOutlineColor(border_color);
|
||||
|
||||
}
|
||||
|
||||
Player::Player(sf::Vector2<float> size, sf::Vector2<float> starting_position, float acceleration, float initial_acceleration, float thickness, float velocity_x, sf::Color inside_color, sf::Color border_color) : Entity(size, starting_position, thickness, inside_color, border_color) {
|
||||
m_acceleration = acceleration;
|
||||
m_jump_strength = initial_acceleration;
|
||||
m_velocity.x = velocity_x;
|
||||
m_thickness = thickness;
|
||||
}
|
||||
|
||||
void Player::handle_movment() {
|
||||
|
||||
Reference in New Issue
Block a user