From c9c0dab34da53fe4a68df6fd94c0cb572affc34a Mon Sep 17 00:00:00 2001 From: Janick Reynders Date: Wed, 14 Jun 2023 00:01:49 +0200 Subject: [PATCH] formatting --- examples/pygame/pygame-use-buttons-to-move-rectangle.py | 1 - examples/tkinter/tk-use-accelerometer-to-move-ball.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/pygame/pygame-use-buttons-to-move-rectangle.py b/examples/pygame/pygame-use-buttons-to-move-rectangle.py index e543f09..7022a4a 100644 --- a/examples/pygame/pygame-use-buttons-to-move-rectangle.py +++ b/examples/pygame/pygame-use-buttons-to-move-rectangle.py @@ -7,7 +7,6 @@ import pygame from kaspersmicrobit import KaspersMicrobit -from kaspersmicrobit.services.accelerometer import AccelerometerData logging.basicConfig(level=logging.INFO) diff --git a/examples/tkinter/tk-use-accelerometer-to-move-ball.py b/examples/tkinter/tk-use-accelerometer-to-move-ball.py index 84a27f6..6425142 100644 --- a/examples/tkinter/tk-use-accelerometer-to-move-ball.py +++ b/examples/tkinter/tk-use-accelerometer-to-move-ball.py @@ -22,9 +22,9 @@ class Ball: def __init__(self, canvas: Canvas, color): self.canvas = canvas - self.position = XY((canvas.winfo_width() / 2) - 5, (canvas.winfo_height() / 2) -5) + self.position = XY((canvas.winfo_width() / 2) - 5, (canvas.winfo_height() / 2) - 5) self.direction = XY(0, 0) - self.id = canvas.create_oval(self.position.x, self.position.y , self.position.x + 10, self.position.y + 10, fill=color) + self.id = canvas.create_oval(self.position.x, self.position.y, self.position.x + 10, self.position.y + 10, fill=color) def draw(self): new_position = XY(self.position.x+self.direction.x, self.position.y+self.direction.y)