Skip to content

Instantly share code, notes, and snippets.

@Insood
Created August 10, 2017 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Insood/51fc53ff61cf92975cc8784d2bb5aca1 to your computer and use it in GitHub Desktop.
Save Insood/51fc53ff61cf92975cc8784d2bb5aca1 to your computer and use it in GitHub Desktop.
import pygame
import random
bg_color = (255,255,255)
clock = pygame.time.Clock()
card = pygame.image.load("card.jpg")
card_size = card.get_rect()
running = True
screen_size = (int(card_size.w)*2, int(card_size.h)*2 )
screen = pygame.display.set_mode( screen_size )
while running:
clock.tick()
#tick_time = clock.get_time()
#total_time += tick_time
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
offsets = [ (0,0), (card_size.w,0), (0,card_size.h), (card_size.w,card_size.h)]
screen.blit(card, offsets[0])
screen.blit(card, offsets[1])
screen.blit(card, offsets[2])
screen.blit(card, offsets[3])
number_x_offset = 23
number_y_offset = 43
number_height = 55
number_width = 55
color = [255,0,0,128]
for card_index in range(0,4):
for x in range(0,5):
for y in range(0,5):
r = random.randint(0,100)
if (r % 50) == 0:
blit_x = offsets[card_index][0] + number_x_offset + number_width*x
blit_y = offsets[card_index][1] + number_y_offset + number_height*y
pygame.draw.rect(screen, color, (blit_x, blit_y, number_width, number_height))
pygame.display.flip()
@Insood
Copy link
Author

Insood commented Nov 20, 2021

I have no idea what this script is for - sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment