Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import random
- pygame.init()
- #Graphics
- win = pygame.display.set_mode((1800, 768), pygame.RESIZABLE)
- pygame.display.set_caption("Jotaro's revenge")
- bg = pygame.image.load('bg.png')
- life = pygame.image.load('heart.png')
- dio = pygame.image.load('dio.png')
- tb = pygame.image.load('pinktb.png')
- font = pygame.font.SysFont('comicsans', 40, True)
- font2 = pygame.font.SysFont('comicsans', 20, True)
- idle = [pygame.image.load('jojo1.png'), pygame.image.load('jojo2.png'), pygame.image.load('jojo3.png'), pygame.image.load('jojo4.png'), pygame.image.load('jojo5.png'), pygame.image.load('jojo6.png'), pygame.image.load('jojo7.png'), pygame.image.load('jojo8.png'), pygame.image.load('jojo9.png'), pygame.image.load('jojo10.png'), pygame.image.load('jojo11.png'), pygame.image.load('jojo12.png'), pygame.image.load('jojo13.png'), pygame.image.load('jojo14.png'), pygame.image.load('jojo15.png'), pygame.image.load('jojo16.png')]
- darken = pygame.image.load('darken.png')
- #Sound
- music = pygame.mixer.music.load('jotaro.mp3')
- timestop = pygame.mixer.Sound('zawordu.wav')
- pygame.mixer.music.play(-1)
- pygame.mixer.music.set_volume(0.2)
- pygame.mixer.music.pause()
- #classes and definitions
- class player(object):
- def __init__(self, x, y, width, height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.vel = 15
- self.hitbox = (137, self.y, self.width, self.height)
- self.walkcount = 0
- def draw(self, win):#Animation
- win.blit(idle[self.walkcount//3], (self.x,self.y))
- self.walkcount += 1
- if self.walkcount == 11:#14 on 1 v6rra v2iksem kui 3 korda (piltide arv)
- self.walkcount = 0
- self.hitbox = (137, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- def hit(self):
- print('hit')
- self.score += 100
- #texts
- class textbox1(object):
- def __init__(self,x,y,width,height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.vel = 6
- self.hitbox = (self.x, self.y, self.width, self.height)
- def draw(self, win):
- text = font.render('the', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- class textbox2(object):
- def __init__(self,x,y,width,height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.vel = 6
- self.hitbox = (self.x, self.y, self.width, self.height)
- def draw(self, win):
- text = font.render('an', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- class textbox3(object):
- def __init__(self,x,y,width,height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.vel = 6
- self.hitbox = (self.x, self.y, self.width, self.height)
- def draw(self, win):
- text = font.render('a', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- class textbox4(object):
- def __init__(self,x,y,width,height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.vel = 6
- self.hitbox = (self.x, self.y, self.width, self.height)
- def draw(self, win):
- text = font.render('No article', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- #class textbox5(object):
- #def __init__(self,x,y,width,height):
- #self.x = x
- #self.y = y
- #self.width = width
- #self.height = height
- #self.vel = 6
- #self.hitbox = (self.x, self.y, self.width, self.height)
- #def draw(self, win):
- #self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), (self.hitbox), 2)
- class text1(object):
- def __init__(self,x,y,width,height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.hitbox = (self.x, self.y, self.width, self.height)
- def draw(self, win):
- win.blit(text1, (self.x, self.y))
- self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- class score(object):
- def __init__(self,x,y,width,height):
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.hitbox = (self.x, self.y, self.width, self.height)
- def draw(self, win):
- text = font.render('Score: ' + str(man.score), 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- self.hitbox = (self.x, self.y, self.width, self.height)
- #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
- #textbox
- class startspeech(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 2529 and article1.x < 2535:
- text = font2.render("H", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2523 and article1.x < 2529:
- text = font2.render("HA", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2517 and article1.x < 2523:
- text = font2.render("HAH", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2511 and article1.x < 2517:
- text = font2.render("HAHA", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2505 and article1.x < 2511:
- text = font2.render("HAHAH", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2499 and article1.x < 2505:
- text = font2.render("HAHAHA", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2493 and article1.x < 2499:
- text = font2.render("HAHAHA!", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2487 and article1.x < 2493:
- text = font2.render("HAHAHA! Y", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2481 and article1.x < 2487:
- text = font2.render("HAHAHA! Yo", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2475 and article1.x < 2481:
- text = font2.render("HAHAHA! You", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2469 and article1.x < 2475:
- text = font2.render("HAHAHA! You c", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2463 and article1.x < 2469:
- text = font2.render("HAHAHA! You ca", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2457 and article1.x < 2463:
- text = font2.render("HAHAHA! You can", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2451 and article1.x < 2457:
- text = font2.render("HAHAHA! You can n", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2445 and article1.x < 2451:
- text = font2.render("HAHAHA! You can ne", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2439 and article1.x < 2445:
- text = font2.render("HAHAHA! You can nev", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2433 and article1.x < 2439:
- text = font2.render("HAHAHA! You can neve", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2427 and article1.x < 2433:
- text = font2.render("HAHAHA! You can never", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2421 and article1.x < 2427:
- text = font2.render("HAHAHA! You can never d", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2415 and article1.x < 2421:
- text = font2.render("HAHAHA! You can never de", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2409 and article1.x < 2415:
- text = font2.render("HAHAHA! You can never def", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2403 and article1.x < 2409:
- text = font2.render("HAHAHA! You can never defe", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2397 and article1.x < 2403:
- text = font2.render("HAHAHA! You can never defea", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2391 and article1.x < 2397:
- text = font2.render("HAHAHA! You can never defeat", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2385 and article1.x < 2391:
- text = font2.render("HAHAHA! You can never defeat m", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2379 and article1.x < 2385:
- text = font2.render("HAHAHA! You can never defeat me", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2373 and article1.x < 2379:
- text = font2.render("HAHAHA! You can never defeat me,", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2367 and article1.x < 2373:
- text = font2.render("HAHAHA! You can never defeat me, D", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2361 and article1.x < 2367:
- text = font2.render("HAHAHA! You can never defeat me, DI", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2355 and article1.x < 2361:
- text = font2.render("HAHAHA! You can never defeat me, DIO", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2349 and article1.x < 2355:
- text = font2.render("HAHAHA! You can never defeat me, DIO,", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2343 and article1.x < 2349:
- text = font2.render("HAHAHA! You can never defeat me, DIO, a", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2337 and article1.x < 2343:
- text = font2.render("HAHAHA! You can never defeat me, DIO, an", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2331 and article1.x < 2337:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2325 and article1.x < 2331:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and m", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2319 and article1.x < 2325:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2313 and article1.x < 2319:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my a", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2307 and article1.x < 2313:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my ar", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2301 and article1.x < 2307:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my arm", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2295 and article1.x < 2301:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2289 and article1.x < 2295:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army o", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2283 and article1.x < 2289:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2277 and article1.x < 2283:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of a", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2263 and article1.x < 2277:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of ar", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2257 and article1.x < 2263:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of art", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2251 and article1.x < 2257:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of arti", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2245 and article1.x < 2251:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of artic", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2239 and article1.x < 2245:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articl", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2233 and article1.x < 2239:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of article", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 2227 and article1.x < 2233:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articles", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- if article1.x > 1900 and article1.x < 2227:
- text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articles.", 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- #class endspeech(object):
- #def __init__(self,x,y):
- #self.x = x
- #self.y = y
- #def draw(self, win):
- #ylesanne
- class task(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 1900 and article1.x < 2227:
- text = font.render('In order to weaken DIO', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- class task2(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 1900 and article1.x < 2227:
- text = font.render('you must destroy the', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- class task3(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 1900 and article1.x < 2227:
- text = font.render('grammatically correct articles', 1, (255,255,255))
- win.blit(text, (self.x, self.y))
- class endspeech(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- self.endlause = "M"
- def draw(self, win):
- if viga == 0:
- if article1.x > 0 and article1.x < 3000:
- text = font2.render(self.endlause, 1, (0,0,0))
- win.blit(text, (self.x, self.y))
- #6ige vastus
- #class answer(object):
- #def __init__(self,x,y):
- #self.x = x
- #self.y = y
- #def draw(self, win):
- #if valik in the:
- #word = "[THE]"
- #elif valik in an:
- #word = "[AN]"
- #elif valik in a:
- #word = "[A]"
- #elif valik in empty:
- #word = "[NO ARTICLE]"
- #if articlevale and article1.x > 1200:
- #text = font.render('The correct article was ' + (word), 1, (255,255,255))
- #win.blit(text, (self.x, self.y))
- #pop up classes
- class boss(object):
- def __init__(self, x, y,):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 1900 and article1.x < 2535 or viga == 0:
- win.blit(dio, (self.x,self.y))
- man.vel = 0
- pygame.mixer.music.pause()
- elif article1.x < 1900:
- man.vel = 15
- pygame.mixer.music.unpause()
- class talk(object):
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 1900 and article1.x < 2535 or viga == 0:
- win.blit(tb, (self.x,self.y))
- class darkmode(object):
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def draw(self, win):
- if article1.x > 1900 and article1.x < 2535 or viga == 0:
- win.blit(darken, (self.x,self.y))
- #SÜDAMED
- class heart(object):
- def __init__(self,x,y,):
- self.x = x
- self.y = y
- self.visible = True
- def draw(self, win):
- if self.visible:
- win.blit(life, (self.x, self.y))
- class heart2(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- self.visible2 = True
- def draw(self, win):
- if self.visible2:
- win.blit(life, (self.x, self.y))
- class heart3(object):
- def __init__(self,x,y):
- self.x = x
- self.y = y
- self.visible3 = True
- def draw(self, win):
- if self.visible3:
- win.blit(life, (self.x, self.y))
- def level():
- article1.vel += 1
- article2.vel += 1
- article3.vel += 1
- article4.vel += 1
- def combobonus():
- bonus = combo * 15
- man.score +=bonus
- def drawgamewindow():
- win.blit(bg,(0,0))
- article1.draw(win)
- article2.draw(win)
- article3.draw(win)
- article4.draw(win)
- #article5.draw(win)
- text2.draw(win)
- text3.draw(win)
- #fail.draw(win)
- elu.draw(win)
- elu2.draw(win)
- elu3.draw(win)
- must.draw(win)
- man.draw(win)
- enemy.draw(win)
- speech.draw(win)
- speech1.draw(win)
- speech2.draw(win)
- goal.draw(win)
- goal2.draw(win)
- goal3.draw(win)
- pygame.display.update()
- #k6ik vajalik
- the = ["... Second World War ended in 1945.","Can Nathan play … piano?","Fred always says dogs make … best pets","Many doctors recommend immunization shots to prevent … flu.","She cured … cold by drinking ginger tea.","We spent … whole time listening to boring speeches.","I spent … summer on a beach in Florida.","She thinks that … world is changing quickly.","Do you know … name of her perfume?","I enjoyed … DVD you gave me for my birthday."," … dentist doesn’t have any openings for two months.","Is there any water on … Moon?","When I turned on my new laptop, … screen exploded!","If … price keeps going up, I’m going to buy an electric car.","Every winter, … lake freezes over and we can go ice skating.","I heard that … mall will house a movie theater."]
- an = ["Whenever I go swimming, I end up with … earache.","I was on the phone with them for … entire hour!","Researchers hope that beneath the frozen layer lies … ocean.","It is … especially important thing!","If I were rich, I would buy … apartment.","It only took … hour.","Wow! That is … expensive car!","Look, there's … orange on the table.","Karen, you have … unusually small head.","Is there … internet cafe around here?","I need to send … important email.","You should take … umbrella with you.","She baked … enormous steak instead.","Greg and Taylor took … amazing vacation to Sweden last week.","Maddie really is … unhappy person."]
- a = ["Do you have … bigger room in the hotel?","She jogs at least four times … week.","We have to find … better way to do this.","This bag is made of … much stronger material than my last one.","That brand of organic coffee costs $90 … pound!","Can you play … musical instrument?","Do you own … Ferrari?","Air should be … universal human right.","He has 3 cats and … horse.","Sammy has … few ideas which could really help us.","She has … few clients, and she isn’t earning very much.","Ned had … stroke last year.","He is from … European country, but I don’t know which one.","Larry doesn’t own … car.","It looks like it’s going to be … rainy day today."]
- empty = ["I’m pretty sure … cheetahs are the fastest animals on the planet.","They have … little money for food or education.","Armadillos are most active at … night.","Have you ever heard of … Halloween?","Do you want to meet up for dinner on … Friday?","I didn’t sleep at all … last night.","Welcome to … Tuvana Island!","This school has … great teachers.","I love … stories like that!","Why do … fruit and … vegetables taste so good?","Tina has … few friends. She should meet more people."]
- laused = [the, an, a, empty]
- run = True
- article1 = textbox1(3000, 125, 1, 25)
- article2 = textbox2(3000, 275, 1, 25)
- article3 = textbox3(3000, 425, 1, 25)
- article4 = textbox4(3000, 575, 1, 25)
- #article5 = textbox5(3000, 600, 1, 25)
- articlevale = False
- suvaline = random.choice(laused)
- text2 = text1(100, 50, 100, 50)
- valik = random.choice(suvaline)
- text1 = font.render(valik, 1, (255,255,255))
- text3 = score(100, 668, 100, 50)
- man = player(100, 300, 65, 125)
- elu = heart(300, 668)
- elu2 = heart2(342, 668)
- elu3 = heart3(384, 668)
- enemy = boss(1000, 400)
- speech = talk(750, 515)
- speech1 = startspeech(830, 580)
- speech2 = endspeech(830, 580)
- goal = task(400, 200)
- goal2 = task2(400, 250)
- goal3 = task3(400, 300)
- #fail = answer(470, 668)
- must = darkmode(0,0)
- man.score = 0
- viga = 3
- combo = 0
- #mainloop
- while run:
- pygame.time.delay(20)
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- run = False
- #artiklite liikumine ja muu tegevus
- article1.x -= article1.vel
- article2.x -= article2.vel
- article3.x -= article2.vel
- article4.x -= article2.vel
- #article5.x -= article2.vel
- if article1.x > 2555 and article1.x < 2560:
- timestop.play()
- #artikkel 1 liikumine
- if article1.y - article1.height < man.hitbox[1] + man.hitbox[3] and article1.y + article1.height > man.hitbox[1]:
- if article1.x + article1.width > man.hitbox[0] and article1.x < man.hitbox[0] + man.hitbox[2]:
- print('1')
- if suvaline == (the):
- print('6IGE')
- man.hit()
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- level()
- combo += 1
- if combo == 3:
- combobonus()
- if combo == 5:
- combobonus()
- if combo == 10:
- combobonus()
- if combo == 15:
- combobonus()
- if combo == 20:
- combobonus()
- else:
- print('vale')
- articlevale = True
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- #article5.x = 3000
- combo = 0
- viga -= 1
- if viga == 0:
- article1.vel = 6
- article2.vel = 6
- article3.vel = 6
- article4.vel = 6
- article1.x = 3001
- article2.x = 3001
- article3.x = 3001
- article4.x = 3001
- if article1.x < 2000:
- article1.vel = 0
- article2.vel = 0
- article3.vel = 0
- article4.vel = 0
- else:
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- if viga == 2:
- elu3.visible3 = False
- elif viga == 1:
- elu2.visible2 = False
- elu3.visible3 = False
- else:
- elu.visible = False
- elu2.visible2 = False
- elu3.visible3 = False
- #artikkel 2 liikumine
- if article2.y - article2.height < man.hitbox[1] + man.hitbox[3] and article2.y + article2.height > man.hitbox[1]:
- if article2.x + article2.width > man.hitbox[0] and article2.x < man.hitbox[0] + man.hitbox[2]:
- print('2')
- if suvaline == (an):
- print('6IGE')
- man.hit()
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- level()
- combo += 1
- if combo == 3:
- combobonus()
- if combo == 5:
- combobonus()
- if combo == 10:
- combobonus()
- if combo == 15:
- combobonus()
- if combo == 20:
- combobonus()
- else:
- print('vale')
- articlevale = True
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- #article5.x = 3000
- combo = 0
- viga -= 1
- if viga == 0:
- article1.vel = 6
- article2.vel = 6
- article3.vel = 6
- article4.vel = 6
- article1.x = 3001
- article2.x = 3001
- article3.x = 3001
- article4.x = 3001
- if article1.x < 2000:
- article1.vel = 0
- article2.vel = 0
- article3.vel = 0
- article4.vel = 0
- else:
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- if viga == 2:
- elu3.visible3 = False
- elif viga == 1:
- elu2.visible2 = False
- elu3.visible3 = False
- else:
- elu.visible = False
- elu2.visible2 = False
- elu3.visible3 = False
- #artikkel 3 liikumine
- if article3.y - article3.height < man.hitbox[1] + man.hitbox[3] and article3.y + article3.height > man.hitbox[1]:
- if article3.x + article3.width > man.hitbox[0] and article3.x < man.hitbox[0] + man.hitbox[2]:
- print('3')
- if suvaline == (a):
- print('6IGE')
- man.hit()
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- level()
- combo += 1
- if combo == 3:
- combobonus()
- if combo == 5:
- combobonus()
- if combo == 10:
- combobonus()
- if combo == 15:
- combobonus()
- if combo == 20:
- combobonus()
- else:
- print('vale')
- articlevale = True
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- #article5.x = 3000
- combo = 0
- viga -= 1
- if viga == 0:
- article1.vel = 6
- article2.vel = 6
- article3.vel = 6
- article4.vel = 6
- article1.x = 3001
- article2.x = 3001
- article3.x = 3001
- article4.x = 3001
- if article1.x < 2000:
- article1.vel = 0
- article2.vel = 0
- article3.vel = 0
- article4.vel = 0
- else:
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- if viga == 2:
- elu3.visible3 = False
- elif viga == 1:
- elu2.visible2 = False
- elu3.visible3 = False
- else:
- elu.visible = False
- elu2.visible2 = False
- elu3.visible3 = False
- #artikkel 4 liikumine
- if article4.y - article4.height < man.hitbox[1] + man.hitbox[3] and article4.y + article4.height > man.hitbox[1]:
- if article4.x + article4.width > man.hitbox[0] and article4.x < man.hitbox[0] + man.hitbox[2]:
- print('4')
- if suvaline == (empty):
- print('6IGE')
- man.hit()
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- level()
- combo += 1
- if combo == 3:
- combobonus()
- if combo == 5:
- combobonus()
- if combo == 10:
- combobonus()
- if combo == 15:
- combobonus()
- if combo == 20:
- combobonus()
- else:
- print('vale')
- articlevale = True
- article1.x = 1900
- article2.x = 1900
- article3.x = 1900
- article4.x = 1900
- #article5.x = 3000
- combo = 0
- viga -= 1
- if viga == 0:
- article1.vel = 6
- article2.vel = 6
- article3.vel = 6
- article4.vel = 6
- article1.x = 3001
- article2.x = 3001
- article3.x = 3001
- article4.x = 3001
- if article1.x < 2000:
- article1.vel = 0
- article2.vel = 0
- article3.vel = 0
- article4.vel = 0
- else:
- suvaline = random.choice(laused)
- text1 = font.render(random.choice(suvaline), 1, (255,255,255))
- if viga == 2:
- elu3.visible3 = False
- elif viga == 1:
- elu2.visible2 = False
- elu3.visible3 = False
- else:
- elu.visible = False
- elu2.visible2 = False
- elu3.visible3 = False
- #player movement
- keys = pygame.key.get_pressed()
- if keys[pygame.K_w] and man.y > man.vel + 69 or keys[pygame.K_UP] and man.y > man.vel + 69:
- man.y -= man.vel
- if keys[pygame.K_s] and man.y < 690 - man.height - man.vel or keys[pygame.K_DOWN] and man.y < 690 - man.height - man.vel:
- man.y += man.vel
- drawgamewindow()
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement