title: Physics used in gravity of falling and jumping objects in Python
body: <p>I am trying to make a flappy bird clone and I can't seem to get the physics right. I'm not great at physics and everytime I try numbers, it always seems to choppy and not like the original. Right now I have a fall and jump increment that is changed each time by multiplying it by a constant to make it fall faster and get slower as it jumps, but it doesn't look right.
  Is there another way to do the physics of jumping?</p>
  
  <p><strong>EDIT</strong> I can't add the rest of the code since that doesn't relate to the problem, so this code will not run without cetain module variables in the rest of my code.</p>
  
  <p>Here is my bird class</p>
  
  <pre><code>class Player():
      def __init__(self,root,canvas,x=150,y=300,size=40):
          global jumped
          #Sets attributes
          self.size=size
          self.faller=True
          self.x=x
          self.y=y
          self.root=root
          self.fell=4 #The initial amount to fall
          jingle=13 #The initial amount to jump
          self.canvas=canvas
          #sets the image
          im=PhotoImage(file="unnamed copy 2.gif")
          self.photo=im
          self.current=self.canvas.create_image((self.x,self.y),image=self.photo)
      def fall(self): #Always runs in the background, if the user isn't jumping, to fall
          global done,t,points,j,height
          if self.faller and not done: 
              self.y+=self.fell
              self.fell*=t    #Falls and multiplies how much it fell by the exponential constant
              if self.y+(height/2)&gt;=600:  # if it hit the ground, it ends the game
                  done=True
                  self.fall()  #Runs the method again to execute the code when done is True
                  return
  
              self.canvas.coords(self.current,(self.x,self.y))
              self.canvas.after(20,self.fall) #Runs it again after 20 milliseconds
          elif done and self.faller:
              self.faller=False  #Stops the falling
              end()
  
  
      def jump(self,e):
          global done,j,jingle,orange,t
          if not done and orange: #If it isnt dead and it has been a
                                  #sufficient time since the user last jumped
              self.faller=False   #Stops the falling
              x=1
              while x&lt;=10:
                  if not done:
                      for item in pipes: #Checks if it has hit each time it goes up
                          if item.hit(self): # if it has, it stops and dies
                              done=True
                              return
                  self.canvas.after(12*x,self.move) # it moves up a little, 10 times
                  x+=1
              self.faller=True #After it is done, it lets itself fall again
              self.fell=4  #Sets the amount it falls back to the default
              jingle=13 #Sets the amount it jumps back to default
              orange=False #Stops the user from jumping really fast, like holding space
              j=.97 #Sets the exponential constants back to normal
              t=1.09
              self.canvas.after(100,self.toll) #After 100 ms, it lets the user jump again
      def toll(self): #sets the boolean that stops jumping back to True
          global orange
          orange=True
      def move(self): #Moves and multiplies how much it moves by the constant
          global jingle,j
          self.y-=jingle
          jingle*=j
          self.canvas.coords(self.current,(self.x,self.y))
      def changey(self,a): #A method to change the user's position
          self.y=a
          self.canvas.coords(self.current,(self.x,self.y))
  </code></pre>