# Problem with my script

This topic is 2781 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey

I have been following "Game From Scratch" tutorials on building a game but my script won't build.

I got to step 6 here: http://www.gamefroms...ion-Part-6.aspx

I get the following errors:

playerpaddle.cpp(32): error C2039: 'IsKeyDown' : is not a member of 'tagINPUT'
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winuser.h(5332) : see declaration of 'tagINPUT'

playerpaddle.cpp(36): error C2039: 'IsKeyDown' : is not a member of 'tagINPUT'
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winuser.h(5332) : see declaration of 'tagINPUT'

playerpaddle.cpp(40): error C2039: 'IsKeyDown' : is not a member of 'tagINPUT'
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winuser.h(5332) : see declaration of 'tagINPUT'

1>c:\users\dave\c++\pang\playerpaddle.cpp(54): error C2064: term does not evaluate to a function taking 1 arguments
[/quote]

Its related to this :

 void PlayerPaddle::Update(float elapsedTime) { if(Game::GetInput().IsKeyDown(sf::Key::Left)) { _velocity-=3.0f; } if(Game::GetInput().IsKeyDown(sf::Key::Right)) { _velocity+=3.0f; } if(Game::GetInput().IsKeyDown(sf::Key::Down)) { _velocity = 0.0f; } if(_velocity > _maxVelocity) _velocity = _maxVelocity; if(_velocity < -_maxVelocity) _velocity = -_maxVelocity; sf::Vector2f pos = this->GetPosition(); if(pos.x <= GetSprite().GetSize().x/2 || pos.x >= (Game::SCREEN_WIDTH - GetSprite().GetSize().x/2)) { _velocity = -_velocity; } GetSprite().Move(_velocity * elapsedTime, 0); } 

What does the error mean so i can work out how i fix it =/ ?

Thanks

##### Share on other sites
The author seems to have forgotten to #include "SFML/Input.hpp", leaving your compiler confused as to what this "sf::Input" nonsense is, making a guess, and guessing incorrectly.

If I'm guessing correctly, at any rate.

##### Share on other sites

The author seems to have forgotten to #include "SFML/Input.hpp", leaving your compiler confused as to what this "sf::Input" nonsense is, making a guess, and guessing incorrectly.

If I'm guessing correctly, at any rate.

There is no Input.hpp in 1.6, at least not one you invoke directly.

That said, I think that is exactly what the problem is. I did make one massive stupid mistake in the tutorial, in that I put the includes in the stdafx.h files, then.... well, forgot to document that step. I've since fixed that ommission, but if you started after I made that fix things would be extremely stupid.

@theFollower, check your stdafx.h and make sure it includes "#include "SFML/Window.hpp".

##### Share on other sites
Hi,

Yes line 15 has:

#include <SFML/Window.hpp>

Should i upload my project to check it or is there something else i can check ?

##### Share on other sites

Hi,

Yes line 15 has:

#include <SFML/Window.hpp>

Should i upload my project to check it or is there something else i can check ?

So, in seeing the code ( posted on StackOverflow ) I see the problem ( your typo ), but you already have your answer on that site, so no need to go into further detail here, unless you are still unclear why you have a problem here.

##### Share on other sites
Ah okay didn't know any one had replied! Knew it was going to be a needle in the haystack ! What a headache that was Thanks!

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 11
• 24
• 43
• 75