title: TypeError: invalid destination position for blit
body: <p>Please help. I've been searching but i still don't quite grasp how to fix the problem. I don't know if i;m forgetting something or the values of x and y are not considered int's for some reason (i have put in past tries to fix it: int(x))</p>
  
  <p>I want to create the dinosaur game from Google, but the .blit of the "Hidrante" class is failing (but the player one is functioning). I have put it normal values instead of self.x and self.y but still get the problem, i've tried to said it x and y are ints, tried to change the names, the image i'm loading, and replicate the code of the player but doesn't seem to work.</p>
  
  <p>here is all the code</p>
  
  <pre><code>import pygame
  
  
  pygame.init()
  
  window = pygame.display.set_mode((1000, 1000))
  
  pygame.display.set_caption("Dinosaurio")
  
  clock = pygame.time.Clock()
  char = pygame.image.load('dino.png')
  bg = pygame.image.load('bg2.jpg')
  img = pygame.image.load("H2.jpg")
  
  
  class Player(object):
  #values of player
      def __init__(self, x, y, width, height):
          self.x = x
          self.y = y
          self.width = width
          self.height = height
          self.vel = 5
          self.isJump = False
          self.jumpCount = 10
          self.hitbox = (self.x + 20, self.y, 30, 64)
  #putting the player on screem
      def draw(self, window):
          window.blit(char, (self.x, self.y))
          self.hitbox = (self.x + 20, self.y, 30, 64)
          pygame.draw.rect(window, (255, 0, 0), self.hitbox, 2)
  
  #Obstacle
  class Hidrante(object):
  
      def __init__(self, x, y, width, height):
          self.x = x
          self.y = y
          self.width = width
          self. height = height
          self.vel = 8
          self.hitbox = (self.x + 17, self.y + 2, 31, 57)
          self.walkCount = 10
          self.path = 0
  #putting the obstacle in screem
      def draw(self, win):
          if self.walkCount + 1 &gt;= 33: #fill code, trying things not actual util
              self.walkCount = 0
  
          if self.vel &gt; 0:
              window.blit(img, (self.x, self.y)) #here is the problem
              self.walkCount += 1
          else:
              window.blit(img, (self.x, self.y))#these too
              self.walkCount += 1
          self.hitbox = (self.x + 17, self.y + 2, 30, 60)  
          pygame.draw.rect(window, (255, 0, 0), self.hitbox, 2)
  
  
  def gmv():
  #putting on creem the objects
      window.blit(bg, (0, 0))
      dino.draw(window)
      hidrante.draw(window)
      pygame.display.update()
  
  #creating the objects
  dino = Player(110, 620, 64, 64)
  hidrante = Hidrante(1100, 620, 64, 64)
  run = True
  neg = 1
  while run:
      clock.tick(30) #frames
      hidrante.x = (hidrante.x ** 2) * -1 #Function to not jump infinit.
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT: 
              run = False
  #Space to jump
      keys = pygame.key.get_pressed()
  
      if not (dino.isJump):
          if keys[pygame.K_SPACE]:
              dino.isJump = True
      else:
          if dino.jumpCount &gt;= -10:
              dino.y -= (dino.jumpCount * abs(dino.jumpCount)) * 0.5
              dino.jumpCount -= 1
          else:
              dino.jumpCount = 10
              dino.isJump = False
  
      gmv()
  
  
  pygame.quit()
  
  </code></pre>
  
  <p>i've only want to know the reason why the values of object are interfering with .blit and learn how to fix it.</p>