Jump to content

How to slow down SDL objects?

- - - - -

  • Please log in to reply
4 replies to this topic

#1
even821

even821

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts
i am making a pong game, but every object in the game move super fast. is there a way to slow down the objects? (i have put in a time frame limit allready, atleast i think it works)

---------- Post added at 11:45 PM ---------- Previous post was at 10:23 PM ----------

never mind, i figured out the problem.

i had the program only limit the first frame lol

#2
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 551 posts
  • Location:/etc/passwd
Err use Lazyfoo's tutorial on limiting a game to a certain FPS.

If that doesn't fix it then you are telling the object to move at a very fast rate...
Code??
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

#3
even821

even821

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts
i did find the problem :)

i had written the code in such a way that the frame rate limit only worked for the first frame. all i had to do was to move one line of the code from outside of my games main loop, into the loop.

#4
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 551 posts
  • Location:/etc/passwd
Well done!
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

#5
even821

even821

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts
haha thanks i guess. :D




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users