diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d7901e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/__pycache__ \ No newline at end of file diff --git a/knob.py b/knob.py new file mode 100644 index 0000000..426b9f4 --- /dev/null +++ b/knob.py @@ -0,0 +1,13 @@ +import pygame + +class Knob: + + def __init__(self, screen): + self.screen = screen + self.radius = screen.get_width()/20 + self.fill_color = (255,0,255) + self.position = (screen.get_width()/2, screen.get_height()/2) + + def display(self): + pygame.draw.circle(self.screen, self.fill_color , self.position, self.radius) + \ No newline at end of file diff --git a/init.py b/main.py similarity index 77% rename from init.py rename to main.py index ed372a1..9d78491 100644 --- a/init.py +++ b/main.py @@ -1,9 +1,14 @@ # Example file showing a basic pygame "game loop" import pygame +from knob import * # pygame setup pygame.init() -screen = pygame.display.set_mode((1280, 720)) +screenW = 561 +screenH = 325 +screen = pygame.display.set_mode((screenW, screenH)) +knob1 = Knob(screen) + clock = pygame.time.Clock() running = True @@ -15,9 +20,11 @@ while running: running = False # fill the screen with a color to wipe away anything from last frame - screen.fill("purple") + screen.fill("black") # RENDER YOUR GAME HERE + knob1.display() + # flip() the display to put your work on screen pygame.display.flip()