I have this code:
import pygame as pg
from pygame.locals import QUIT
pg.init()
pg.display.set_caption("Cookie clicker")
DISPLAY = pg.display.set_mode((500, 300))
c = pg.image.load("cookie.png")
cookie = pg.transform.scale(c, (150,150))
mid = 250,150
mid = cookie.get_rect(center=(mid))
#other imgs here
cpc = 1
money = 0
cps = 0
cookies = 0
class draw(main,sidebar_popup):
def upd():
pg.display.update()
def draw(main):
pg.blit(cookie,mid)
def draw(sidebar_popup):
#show a sidebar
run = True
while run:
draw(main)
for event in pg.event.get():
if event.type == QUIT:
run = False
I want to be able to use draw(#image)
to show images when I need but I don't know how to use class
function.
I am trying to make a cookie clicker on pygame and learning as I go along.
Ps. I am new to pygame and haven't fully learnt python so dont really understand class
yet.