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 - McMeatMan

Pages: [1]
1
General / Avoid Repeating Input-Events
« on: December 09, 2011, 08:15:21 pm »
Hi,

I have following problem in this Code:

Quote

      if(Window.GetInput().IsKeyDown(sf::Key::Down))
      {
         Sprite.Move(0,100 * ElapsedTime);
      }   



the sprite just shall go one time down, but if i write this into the code:

Quote

               while( Window.GetInput().IsKeyDown(sf::Key::Down) )


the Window crashes because of an infinity loop.

I hope you know the answear :)

2
General / SFML crashes
« on: December 08, 2011, 10:11:37 pm »
Hi,
everytime when i put this in the code:
Quote

   if(App.GetInput().IsKeyDown(sf::Key::Down))
   {
      Sprite.Move(0,100 * ElapsedTime); //it just shall go 1 time down
      while(App.GetInput().IsKeyDown(sf::Key::Down)){}
   }   


the program crashes after pressing the down button , i hope you know how to solve the problem ;)

Sorry for my bad english :oops:,   i am german

Pages: [1]
anything