title: How can I fix where the player circle moves with the w,a,s,d keys in the grid I created
body: <p>Okay, so my for my final project I'm creating a dungeon crawler and I have a grid set up where the player moves and thus far I'm working on getting the GUI finished before I link the rest of the files together with the attack function. Anyways my issue is that my player circle won't move in the grid I created, here is the code if you don't know what I mean:</p>
  
  <p>gui.py</p>
  
  <pre><code>try:
      from tkinter import *
  
  except ImportError as err:
      print('a', err)
  
  from player import *
  
  class SimpleGUI:
      def __init__(self):
          self.window = Tk()
          self.window.title('Final Project')
          self.window.protocol('WM_DELETE_WINDOW',self.exit)
          self.canvas = Canvas(self.window,
                               width = 245,
                               height = 550,
                               bg = 'white')
          self.canvas.pack()
  
          self.player = Player()
  
          self.canvas.focus_set()
          self.canvas.bind('w', self.w_key)
          self.canvas.bind('a', self.a_key)
          self.canvas.bind('s', self.s_key)
          self.canvas.bind('d', self.d_key)
  
  
          self.running = True
          self.menu = Menu
  
          self.bt1 = Button(self.window,
                           text = 'Start',
                           command = self.menu)
          self.bt1.pack()
  
  
  
  
          self.mainloop()
          self.window.mainloop()
  
      def mainloop(self):
          while self.running:
              self.canvas.delete(ALL)
              #boss square
              boss_start = self.canvas.create_rectangle(100,0,150,100, outline = 'black', fill = 'black', width = 2)
              #player start square
              ply_start = self.canvas.create_rectangle(100,500,150,550, outline = 'black', fill = 'black', width = 2)
              #row 9
              self.canvas.create_rectangle(0,50,50,100, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,50,100,100, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,50,150,100, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,50,200,100, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,50,250,100, outline = 'black', fill = 'black', width = 2)
              #row 8
              self.canvas.create_rectangle(0,100,50,150, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,100,100,150, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,100,150,150, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,100,200,150, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,100,250,150, outline = 'black', fill = 'black', width = 2)
              #row 7
              self.canvas.create_rectangle(0,150,50,200, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,150,100,200, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,150,150,200, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,150,200,200, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,150,250,200, outline = 'black', fill = 'black', width = 2)
              #row 6
              self.canvas.create_rectangle(0,200,50,250, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,200,100,250, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,200,150,250, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,200,200,250, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,200,250,250, outline = 'black', fill = 'black', width = 2)
              #row 5
              self.canvas.create_rectangle(0,250,50,300, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,250,100,300, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,250,150,300, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,250,200,300, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,250,250,300, outline = 'black', fill = 'black', width = 2)
              #row 4
              self.canvas.create_rectangle(0,300,50,350, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,300,100,350, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,300,150,350, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,300,200,350, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,300,250,350, outline = 'black', fill = 'black', width = 2)
              #row 3
              self.canvas.create_rectangle(0,350,50,400, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,350,100,400, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,350,150,400, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,350,200,400, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,350,250,400, outline = 'black', fill = 'black', width = 2)
              #row 2
              self.canvas.create_rectangle(0,400,50,450, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,400,100,450, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,400,150,450, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,400,200,450, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,400,250,450, outline = 'black', fill = 'black', width = 2)
              #row 1
              self.canvas.create_rectangle(0,450,50,500, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(50,450,100,500, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(100,450,150,500, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(150,450,200,500, outline = 'black', fill = 'black', width = 2)
              self.canvas.create_rectangle(200,450,250,500, outline = 'black', fill = 'black', width = 2)
              self.player.draw(self.canvas)
  
              self.canvas.after(30)
              self.canvas.update()
  
      def button1(self):
          print('working')
  
      def a_key(self, event):
          self.player.x -= self.player.speed
  
      def w_key(self, event):
          self.player.y -= self.player.speed
  
      def s_key(self, event):
          self.player.y += self.player.speed
  
      def d_key(self, event):
          self.player.x += self.player.speed
  
      def exit(self):
          self.running = False
          self.window.destroy()
  
  
  if __name__ == '__main__':
      SimpleGUI()
  </code></pre>
  
  <p>player.py</p>
  
  <pre><code>class Player:
      def __init__(self, hp = 100, defense = 10, strength = 10):
          self.hp = hp
          self.defense = defense
          self.strength = strength
          self.x = 0
          self.y = 0
          self.speed = 64
  
      def draw(self, canvas): 
          canvas.create_oval(self.x,self.y,self.x+45,self.y+45, fill='red') 
  
  if __name__ == '__main__':
      player = Player()
  </code></pre>