1
General / Problem with my Game class and const sf::Input
« on: February 22, 2010, 08:20:08 pm »
aye, thanks. It is working now fine. I forgot that there is something like the initializer list :lol: .
greetz
greetz
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
class c_Game
{
private:
sf::RenderWindow* screen;
sf::Event* events;
c_Object* player;
c_Object* object;
float eTime;
const sf::Input input;
public:
c_Game()
{
screen = new sf::RenderWindow(VideoMode(800,600,32), "hi");
screen->UseVerticalSync(true);
player=new c_Object(0,0,100,100,sf::Color(0,255,0,100));
object=new c_Object(300,300,100,100,sf::Color(100,100,0,100));
events=new sf::Event();
input=screen->GetInput();
}
.
.
.
if (input.IsKeyDown(Key::D))
{
player->Move(500*eTime,0);
}
if (screen->GetInput().IsKeyDown(Key::D))
{
player->Move(500*eTime,0);
}