Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - Nightspark

Pages: [1]
1
Graphics / Thanks, but why is that?
« on: May 22, 2011, 11:53:25 pm »
Thank you, that fixed everything perfectly. Just curious though, why would putting those calls in the GetEvent() loop cause a delay?

2
Graphics / Delays in sprite movement
« on: May 22, 2011, 01:08:57 am »
I got my program so I can move a sprite in all eight directions, or in a circle if I want, using the arrow keys. The problem occurs whenever I press a key, either to start moving or change direction. The character moves once, waits a half second or so, then moves steadily like I wanted. Any ideas what could be causing this delay/lag between movements? My input method is pretty standard.

//Located in event loop, same program structure in every SFML tut out there.

if (App.GetInput().IsKeyDown(sf::Key::Left))
       Player.SetSubRect(0, 0, 128, 128); //facing left
       Player.Move(-1, 0);

if (App.GetInput().IsKeyDown(sf::Key::Right))
       Player.SetSubRect( 128, 128, 256, 256); //facing right
       Player.Move(1, 0);

if (App.GetInput().IsKeyDown(sf::Key::Up))
       Player.Move(0, -1);

if (App.GetInput().IsKeyDown(sf::Key::Down))
       Player.Move(0, 1);

Pages: [1]
anything