Primary Expression Error (Help?)
Apr 3, 2019 at 12:48am UTC
I keep getting an "expected primary-expression before '.' token" on lines 6 and 12. Does anyone know what's wrong? Thanks. I am using SFML and a sprite to make a character move.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (Event.type)
{
case sf::Event::Closed:
window.close();
break ;
case sf::Event::KeyPressed:
if (Event.key.code == Keyboard::Up)
break ;
}
}
window.clear(Color::Black);
window.draw(playerSprite);
window.display();
}
return 0;
}
Last edited on Apr 3, 2019 at 12:50am UTC
Apr 3, 2019 at 2:05am UTC
You wrote Event but meant event on both lines 6 and 12.
Last edited on Apr 3, 2019 at 2:05am UTC
Topic archived. No new replies allowed.