I put my question here because I don't really know where else to put it.
I have a weird problem that i've never had before, I can't find a soulution to the problem.
When I start the game and I am controlling my sprite up,down,left,right it moves one pixel to a direction, stops for a sec, and then it moves weirdly foward. It almost looks like it is lagging foward. But if i remove the Event I can control the sprite normaly with no issues. But the problem is if I have no event the window gets get fucked up, and I can't max window or move window, and get the message "Program not responding".
I want to control the sprite just as good as I can when I play without events.
Sorry, I know I have explained my problem badly. But it is hard to explain this problem, and my english is bad.
But if anyone understand what I am trying say and knows a solution please reply.
Here is my main.cpp if it is of any help to understand. I don't think other code is relevant to this problem.
Main.cpp
#include <SFML/Graphics.hpp>
#include "data.hpp"
#include "controls.hpp"
#include "window.hpp"
#include "menu.hpp"
#include "act.hpp"
int main()
{
Data.datainit();
app.window.create(sf::VideoMode(videowidth,videoheight,32),"Game Engine");
app.window.setFramerateLimit(fps);
while(app.window.isOpen())
{
sf::Event events;
if(app.window.pollEvent(events))
{
if (events.type == sf::Event::Closed) app.window.close();
Act.actinit();
}
}
return 0;
}