title: Pygame rectangle move
body: <p>I'm quite new to pygame. I managed to create a class which draws a rect. </p>
  
  <p>I'll be using this class to make multiple shapes, and try to move a shape when it's clicked. But before I create more shapes, I have to be sure that I can move it. 
  But I didn't succeed in moving just even one shape.</p>
  
  <p><strong>Example.py</strong></p>
  
  <pre><code>import pygame, sys
  from pygame.locals import *
  
  # Global variables
  
  whiteColor = (255, 255, 255)
  darkColor = (51, 51, 51)
  lightColor = (83, 83, 83)
  blackColor = (0, 0, 0)
  
  # Classes
  
  class obj_disk(object):
      def __init__(self):
          self.rect = pygame.draw.rect(screen, blackColor, (0,0,234,32))
  
  # Methods
  
  def game_settings():
      """
      Manage all the main settings for the game.
      @Global screen: The main window
      """
  
      global screen
  
      pygame.init()
      pygame.display.set_caption("Towers of Hanoi")
      pygame.time.Clock().tick(60)
      pygame.time.wait(10)
  
      screen = pygame.display.set_mode([800,600])
      screen.fill(darkColor)
  
      create_objects()
  
      pygame.display.update()
  
  def create_objects():
      """
      Creates all the objects that are required to play the game.
      """
  
      # Create disks
      disk_array = []
      for i in range(0,1):
          disk_array.append(obj_disk())
  
      disk_array[0].rect.move(40,50)
  
  def game_start():
      """
      Starts the game and handles all the events.
      """
  
      while True:
          for event in pygame.event.get():
              if event.type == QUIT:
                  pygame.quit()
                  sys.exit()
  
  if __name__ == '__main__':
      game_settings()
      game_start()
  </code></pre>