Pracuje nad programem i w wyznaczonym przez ścianę kropek w fragmencie kodu komendy wywołujące funkcje pojawia mi się błąd
error: expected initializer before '.' token
Nie wiem jak go usunąć.
#include <SFML/Graphics.hpp>
struct player //struktura gracz
{
sf::Sprite sprajt; //sprajt gracza
sf::Texture tekstura_1;
void ruch(int i, sf::Sprite sprit); //funkcja pozwalająca na poruszanie się
// void grawitacja(int i); //funkcja odpowiedzialna za grawitacje
};
int main()
{
sf::RenderWindow okno( sf::VideoMode( 1280, 800, 32 ), "SpaceWar" );
sf::RectangleShape podloga( sf::Vector2f( 1280, 50 ) ); // tworzymy prostok¹t
podloga.setPosition( 0, 750 ); // i ustawiamy mu pozycjê
podloga.setFillColor(sf::Color(0, 245, 62));
player gracz;
gracz.tekstura_1.loadFromFile("kwadrat.png"); //"pomalowanie" tekstury
gracz.sprajt.setTexture(gracz.tekstura_1);
while( okno.isOpen() )
{
sf::Event zdarzenie;
while( okno.pollEvent( zdarzenie ) )
{
int rucha =0 ;
if( zdarzenie.type == sf::Event::Closed )
okno.close();
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Escape )
okno.close();
//******************************************************************************************
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Left )
{
int rucha = 1;
void gracz.ruch(rucha, gracz.sprajt); }
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Right )
{
int rucha = 2;
void gracz.ruch(rucha, gracz.sprajt);
}
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Down)
{
int rucha = 3;
void gracz.ruch(rucha, gracz.sprajt);
}
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Up)
{
int rucha = 4;
void gracz.ruch(rucha, gracz.sprajt);
}
rucha = 0;
//********************************************************************************************************
}
okno.clear( sf::Color( 0, 150, 255 ) );
okno.draw(player.sprajt);
okno.draw(podloga);
okno.display();
}
return 0;
}
player::player(sf.Texture tekstura)
{
sprajt.setTexture(tekstura);
sprajt.setPosition(0,720);
}
void ruch(int i, gracz.sprajt)
{
switch(i)
case 1:
{
sprit.move(10,0);
break;
}
case 2:
{
sprit.move(-10,0);
break;
}
case 3:
{
sprit.move(0,10);
break;
}
case 4:
{
sprit.move(0,-10);
}
return;
}
//void grawitacja()
//{
// int k;
// k = 3;
// void ruch(3);
//}