Hello folks, I am pretty new to SFML and had a few questions in regards to the most common techniques for setting up games. I kind of made the mistake of not starting with a player class and am at the point where I want to roll a lot of my code into classes. Player and Input being two of them. So my question is do most people have a class just for input, and another class for player functions? Here is how I have my player class looking at the moment and am starting to second guess my self into making an input class for just mouse and keyboard input.
Player.cpp
#pragma once
#include "Player.h"
#include <SFML/Graphics.hpp>
Player::Player(const sf::Texture& imagePath) :
mSprite(imagePath),
mSource(1, Player::Down)
{
mSprite.setScale(1.5f, 1.5f);
}
Player::~Player()
{
// TODO Auto-generated destructor stub
}
void Player::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
target.draw(mSprite, states);
}
void Player::moveUp()
{
//mainChar.move(sf::Vector2f(0, -10));
}
void Player::moveDown()
{
}
void Player::moveLeft()
{
}
void Player::moveRight()
{
};
It's obviously ready to start going with player input but if making a separate class just for input is the more appropriate way to go, then I'll adjust accordingly.
Thanks for any and all input folks.