Hi, I don´t know what to do to get my object (picture) to move. This is what I have so far:
1st method in a class:
self.player1 = tkinter.PhotoImage(file="player1.png")
2nd method in a class:
self.player1_x = j*50
self.player1_y = i*50
self.canvas.create_image(self.player1_x, self.player1_y, anchor=NW, image=self.player1)
>> this put this image in a square grid
3rd method in a class (clicking on a specific button calls this method):
self.player1_x = self.player1_x
self.player1_y -= 50
self.canvas.move(self.player1, self.player1_x, self.player1_y)
When I make it like this, nothing happens. It doesn´t move an image. Can you help me with that? Thanks.
1st method in a class:
self.player1 = tkinter.PhotoImage(file="player1.png")
2nd method in a class:
self.player1_x = j*50
self.player1_y = i*50
self.canvas.create_image(self.player1_x, self.player1_y, anchor=NW, image=self.player1)
>> this put this image in a square grid
3rd method in a class (clicking on a specific button calls this method):
self.player1_x = self.player1_x
self.player1_y -= 50
self.canvas.move(self.player1, self.player1_x, self.player1_y)
When I make it like this, nothing happens. It doesn´t move an image. Can you help me with that? Thanks.