About 723,000 results
Open links in new tab
  1. Moving an object in PyGamePython | GeeksforGeeks

    Apr 11, 2025 · We will see how to move an object such that it moves horizontally when pressing the right arrow key or left arrow key on the keyboard and it moves vertically when pressing up arrow key or down arrow key. We’ll create a game window, draw an object and update its position based on user input.

  2. tkinter - Moving objects in python? - Stack Overflow

    Feb 5, 2016 · I'm trying to move the ovals up to the top of the canvas, and my instructions are to move them using a for loop. Do I use the for loop to traverse the list? And how do I ensure the mines keep moving up throughout the program's runtime? Also, the base code I've been given doesn't take any parameters.

  3. Python Tkinter | Moving objects using Canvas.move() method

    Aug 2, 2023 · The Canvas class of Tkinter supports functions that are used to move objects from one position to another in any canvas or Tkinter top-level. Syntax: Canvas.move(canvas_object, x, y) Parameters: canvas_object is any valid image or drawing created with the help of Canvas class. To know how to create object using Canvas class take reference of this.

  4. python - Moving an object left and right - Stack Overflow

    Jul 6, 2012 · For pygame you can get input in two methods [1] key events, or [2] key polling -- You are using the first (event) method. For this you want the 2nd method. See stackoverflow.com/a/11365418/341744 for code. -- If this were a FPS, you want polling for WASD movement, and events for mousedown.

  5. Automatically Moving Shape? Python 3.5 Tkinter - Stack Overflow

    Jan 21, 2017 · You can use root.after(milliseconds, function_name) to run function periodically and it can use canvas.move(object_id, offset_x, offset_y) to move object automatically. And you can use canvas.coords(object_id, x1, y1, x2, y2) to set new position using mouse position.

  6. Draw moving object using Turtle in Python - GeeksforGeeks

    Sep 12, 2023 · Turtle is an inbuilt module in python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle. To move turtle, there are some functions i.e forward (), backward (), etc. Import Turtle package. Set screen with dimensions and color. Form turtle object with color.

  7. Python tkinter moving objects using move() on Canvas - Plus2net

    Moving rectangle on a Tkinter Canvas by using move() in two directions by using a button

  8. Pygame Tutorial - Basic Movement & Key Presses - Tech with Tim

    This pygame tutorial teaches charatcer movement. How to move a charatcer around the screen using the python module pygame.

  9. Python tkinter moving items on Canvas using button or by timer

    There are two ways to move the object in a Canvas. The basic concept of moving any item in canvas is to create , delete and then create the same item in new area by changing the coordinates. ( This is discussed here ) For a rectangle we have two coordinates ( x1, y1 ) …

  10. Python: Moving an Object Class in X and Y Directions

    Jan 26, 2025 · By creating a class to represent an object and defining methods to move it along the X and Y axes, we can build complex interactive systems. This blog post will guide you through the fundamental concepts, usage methods, common practices, and best practices for moving an object class in the X and Y directions in Python.

Refresh