diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..849cb05 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,15 @@ +############################################################################ +# Made by the individual programmer. +# ismayeel +############################################################################ + +################################ +# Copyright (c) 2024 +################################ + +################################################################ +# gmail: ismayeelanver@gmail.com +# github: https://github.com/ismayeelanver +# other contributors: none +# support: none +# documentation: https://shootery.github.io/ \ No newline at end of file diff --git a/__pycache__/menu.cpython-312.pyc b/__pycache__/menu.cpython-312.pyc new file mode 100644 index 0000000..4d35a97 Binary files /dev/null and b/__pycache__/menu.cpython-312.pyc differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..aa175ef --- /dev/null +++ b/main.py @@ -0,0 +1,23 @@ +import pygame +from menu import * + + +scene = "menu" +pygame.display.set_caption(scene) + +w = 800 +h = 600 + +screen = pygame.display.set_mode((w, h)) + +pb = Button(400, 300, 100, 50, "Play") +lb = Button(400, 400, 100, 50, "License") +while True: + if scene == "menu": + screen.fill("BLACK") + pb.draw(screen) + lb.draw(screen) + for event in pygame.event.get(): + if event.type == pygame.QUIT: + exit() + pygame.display.update() \ No newline at end of file diff --git a/menu.py b/menu.py new file mode 100644 index 0000000..868fe9f --- /dev/null +++ b/menu.py @@ -0,0 +1,20 @@ +import pygame +pygame.font.init() +class Button(pygame.sprite.Sprite): + def __init__(self, x, y, width, height, text): + self.x = x + self.y = y + self.width = width + self.height = height + self.text = text + self.image = pygame.Surface((self.width, self.height)) + self.image.fill((255, 255, 255)) + self.rect = self.image.get_rect() + self.rect.center = (self.x, self.y) + self.font = pygame.font.Font(None, 20) + self.rect.w = self.width + self.rect.h = self.height + self.text_surface = self.font.render(self.text, True, (0, 0, 0)) + def draw(self, surface): + surface.blit(self.image, self.rect) + surface.blit(self.text_surface, (self.rect.x + 5, self.rect.y + 5)) \ No newline at end of file diff --git a/player.png b/player.png new file mode 100644 index 0000000..8c82282 Binary files /dev/null and b/player.png differ diff --git a/player1.png b/player1.png new file mode 100644 index 0000000..c417da3 Binary files /dev/null and b/player1.png differ