Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ismayeelisme committed May 15, 2024
0 parents commit 2d31710
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
15 changes: 15 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
############################################################################
# Made by the individual programmer.
# ismayeel
############################################################################

################################
# Copyright (c) 2024
################################

################################################################
# gmail: [email protected]
# github: https://github.com/ismayeelanver
# other contributors: none
# support: none
# documentation: https://shootery.github.io/
Binary file added __pycache__/menu.cpython-312.pyc
Binary file not shown.
23 changes: 23 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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()
20 changes: 20 additions & 0 deletions menu.py
Original file line number Diff line number Diff line change
@@ -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))
Binary file added player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added player1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d31710

Please sign in to comment.