title: How to make Wall Jump work in Python/Pygame
body: <p>was just wondering if anyone out there can help me to make my character wall jump inside of this game that I am making with Pygame. So far I have tried multiple collide collision functions but nothing works, what I need is for the character to jump when either on the ground or on the side of a platform or wall. Any and all help is appreciated, and here's the code:</p>
  
  <pre><code>def jump(self):
          """ Called when user hits 'jump' button. """
  
          # move down a bit and see if there is a platform below us.
          # Move down 2 pixels because it doesn't work well if we only move down 1
          # when working with a platform moving down.
          self.rect.y += 2
          platform_hit_list = pygame.sprite.spritecollide(self, self.level.platform_list, False)
  
          for block in platform_hit_list:
  
              if pygame.sprite.collide_rect(self,block) or pygame.sprite.collide_rect(block,self):
  
                  self.change_y = -8.5
                  print("I am reading this!")
  
          self.rect.y -= 2
  
          # If it is ok to jump, set our speed upwards
          if len(platform_hit_list) &gt; 0 or self.rect.bottom &gt;= constants.SCREEN_HEIGHT:
              self.change_y = -8.5
  </code></pre>
  
  <p>For the if statement I've tried the following conditions: </p>
  
  <pre><code>if pygame.sprite.collide_rect(self.rect,block.rect) or 
  pygame.sprite.collide_rect(self.rect,block.rect)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>if pygame.sprite.collide_rect(self.rect.right,block.rect.left) or
   pygame.sprite.collide_rect(self.rect.right,block.rect.left)
  </code></pre>