commit eee33a4fabc9e7518fc24bb8d32d874f08a1bdc6 Author: Zezik Date: Sat Sep 12 08:48:23 2026 +0200 first commit diff --git a/BGE.py b/BGE.py new file mode 100644 index 0000000..c65c240 --- /dev/null +++ b/BGE.py @@ -0,0 +1,161 @@ +import pygame, random +pygame.init() +win_width, win_height = 1280, 720 +win = pygame.display.set_mode((win_width, win_height)) +pygame.display.set_caption("Best Gaem Evur!") +font = pygame.font.SysFont('', 200) +clock = pygame.time.Clock() + +# Images +pic_arrow = [ + pygame.image.load("img/arrowU.png"), + pygame.image.load("img/arrowD.png")] + +pic_heart = [ + pygame.image.load("img/heartE.png"), + pygame.image.load("img/heartF.png")] + +pic_hp = pygame.image.load("img/hp.png") + +pic_num = [ + pygame.image.load("img/num0.png"), + pygame.image.load("img/num1.png"), + pygame.image.load("img/num2.png"), + pygame.image.load("img/num3.png"), + pygame.image.load("img/num4.png"), + pygame.image.load("img/num5.png"), + pygame.image.load("img/num6.png"), + pygame.image.load("img/num7.png"), + pygame.image.load("img/num8.png"), + pygame.image.load("img/num9.png"), + pygame.image.load("img/numA.png"), + pygame.image.load("img/numB.png"), + pygame.image.load("img/numC.png"), + pygame.image.load("img/numD.png")] + +# Variables +arrow = [0, 0] + +cards = [ # [playable, value] + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0], + [True, 0]] + +end_card = [True, True] + +hp = [2, 2] + +score = [0, 0] + +def draw_arrow(): + win.blit(pic_arrow[1], (arrow[0], 425)) + +def draw_cards(): + for i in range(9): + win.blit(pic_num[11], (i*128, 64)) + if cards[i][0] == True: + win.blit(pic_num[cards[i][1]], (i*128, 525)) + else: + win.blit(pic_num[11], (i*128, 525)) + if end_card[0] == True: + win.blit(pic_num[12], (1152,525)) + else: + win.blit(pic_num[13], (1152,525)) + win.blit(pic_num[13], (1152,64)) + +def draw_hp(): + win.blit(pic_hp, (0,0)) + win.blit(pic_hp, (0,650)) + if hp[0] == 0: + win.blit(pic_heart[0], (64, 650)) + win.blit(pic_heart[0], (128, 650)) + elif hp[0] == 1: + win.blit(pic_heart[1], (64, 650)) + win.blit(pic_heart[0], (128, 650)) + else: + win.blit(pic_heart[1], (64, 650)) + win.blit(pic_heart[1], (128, 650)) + + if hp[1] == 0: + win.blit(pic_heart[0], (64, 0)) + win.blit(pic_heart[0], (128, 0)) + elif hp[1] == 1: + win.blit(pic_heart[1], (64, 0)) + win.blit(pic_heart[0], (128, 0)) + else: + win.blit(pic_heart[1], (64, 0)) + win.blit(pic_heart[1], (128, 0)) + +def draw_score(): + global score + my_score = font.render(str(score[0]), 1, (0,0,0)) + enemy_score = font.render(str(score[1]), 1, (0,0,0)) + win.blit(my_score, (int(640 - my_score.get_rect().width/2), 361)) + win.blit(enemy_score, (int(640 - enemy_score.get_rect().width/2), 221)) + +def generate_cards(): + global cards + my_cards = [0,1,2,3,4,5,6,7,8,9] + enemy_cards = [0,1,2,3,4,5,6,7,8,9] + random.shuffle(my_cards) + random.shuffle(enemy_cards) + for i in range(9): + cards[i][1] = my_cards[i] + cards[i+9][1] = enemy_cards[i] + +generate_cards() + +run = True +while run: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + run = False + + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_q: + run = False + + if event.key == pygame.K_LEFT or event.key == pygame.K_a: + if arrow[0] >= 128: + arrow[0] -= 128 + else: + arrow[0] = 1152 + + if event.key == pygame.K_RIGHT or event.key == pygame.K_d: + if arrow[0] <= 1024: + arrow[0] += 128 + else: + arrow[0] = 0 + + if event.key == pygame.K_RETURN or event.key == pygame.K_SPACE: + if arrow[0] != 1152 and end_card[0] == True: + if cards[int(arrow[0]/128)][0] != False: + cards[int(arrow[0]/128)][0] = False + score[0] += cards[int(arrow[0]/128)][1] + else: + end_card[0] = False + + win.fill((255,255,255)) + draw_arrow() + draw_cards() + draw_hp() + draw_score() + pygame.display.update() + clock.tick(30) + +pygame.quit() \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e299725 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +fuk u diff --git a/img/arrowD.png b/img/arrowD.png new file mode 100644 index 0000000..dcc4c5d Binary files /dev/null and b/img/arrowD.png differ diff --git a/img/arrowU.png b/img/arrowU.png new file mode 100644 index 0000000..7158184 Binary files /dev/null and b/img/arrowU.png differ diff --git a/img/heartE.png b/img/heartE.png new file mode 100644 index 0000000..6565c94 Binary files /dev/null and b/img/heartE.png differ diff --git a/img/heartF.png b/img/heartF.png new file mode 100644 index 0000000..c798f53 Binary files /dev/null and b/img/heartF.png differ diff --git a/img/hp.png b/img/hp.png new file mode 100644 index 0000000..f8e3d90 Binary files /dev/null and b/img/hp.png differ diff --git a/img/num.png b/img/num.png new file mode 100644 index 0000000..f3f3b3c Binary files /dev/null and b/img/num.png differ diff --git a/img/num0.png b/img/num0.png new file mode 100644 index 0000000..37360d8 Binary files /dev/null and b/img/num0.png differ diff --git a/img/num1.png b/img/num1.png new file mode 100644 index 0000000..3de8876 Binary files /dev/null and b/img/num1.png differ diff --git a/img/num2.png b/img/num2.png new file mode 100644 index 0000000..a2f6767 Binary files /dev/null and b/img/num2.png differ diff --git a/img/num3.png b/img/num3.png new file mode 100644 index 0000000..d9fed5d Binary files /dev/null and b/img/num3.png differ diff --git a/img/num4.png b/img/num4.png new file mode 100644 index 0000000..c445f0f Binary files /dev/null and b/img/num4.png differ diff --git a/img/num5.png b/img/num5.png new file mode 100644 index 0000000..4b27574 Binary files /dev/null and b/img/num5.png differ diff --git a/img/num6.png b/img/num6.png new file mode 100644 index 0000000..11752c7 Binary files /dev/null and b/img/num6.png differ diff --git a/img/num7.png b/img/num7.png new file mode 100644 index 0000000..f4cd536 Binary files /dev/null and b/img/num7.png differ diff --git a/img/num8.png b/img/num8.png new file mode 100644 index 0000000..4152d42 Binary files /dev/null and b/img/num8.png differ diff --git a/img/num9.png b/img/num9.png new file mode 100644 index 0000000..91fd400 Binary files /dev/null and b/img/num9.png differ diff --git a/img/numA.png b/img/numA.png new file mode 100644 index 0000000..8a7c629 Binary files /dev/null and b/img/numA.png differ diff --git a/img/numB.png b/img/numB.png new file mode 100644 index 0000000..62be91d Binary files /dev/null and b/img/numB.png differ diff --git a/img/numC.png b/img/numC.png new file mode 100644 index 0000000..8f906a7 Binary files /dev/null and b/img/numC.png differ diff --git a/img/numD.png b/img/numD.png new file mode 100644 index 0000000..30525c6 Binary files /dev/null and b/img/numD.png differ