diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/MrJacksonSpinner.iml b/.idea/MrJacksonSpinner.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/MrJacksonSpinner.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..7ec7bf7 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,23 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a971a2c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3826e6f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7043000 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Mr. Jackson Spinner +The first ever facial spinner program that features Mr. Jackson. Other faces include those of John Green and David Coday. + +### Credits +Developed in Pygame by Zer0-Official +Includes images of Kevin Jackson, John Green, and David Coday \ No newline at end of file diff --git a/img/coday.png b/img/coday.png new file mode 100644 index 0000000..b660784 Binary files /dev/null and b/img/coday.png differ diff --git a/img/green.png b/img/green.png new file mode 100644 index 0000000..b177d30 Binary files /dev/null and b/img/green.png differ diff --git a/img/mrj.png b/img/mrj.png new file mode 100644 index 0000000..1f04e10 Binary files /dev/null and b/img/mrj.png differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..25418a2 --- /dev/null +++ b/main.py @@ -0,0 +1,77 @@ +import pygame + +pygame.init() + +clock = pygame.time.Clock() +scrn = pygame.display.set_mode((300, 300)) +pygame.display.set_caption('Mr. Jackson Spinner') + +WHITE = (255, 255, 255) +BLACK = (0, 0, 0) + +mrJ = pygame.transform.scale(pygame.image.load('img/mrj.png'), (300, 300)) +img = 1 +rotation = 0 +rpf = 5 +move = False +show = True +x, y = 0, 0 +pos = (0, 0) +font = pygame.font.SysFont('arial', 12) + +while True: + for e in pygame.event.get(): + if e.type == pygame.QUIT or (e.type == pygame.KEYDOWN and e.key == pygame.K_q): + pygame.quit() + elif e.type == pygame.MOUSEBUTTONDOWN: + if abs(rpf) > 40: + rpf = 0 + else: + if rpf < 0: + rpf -= 5 + else: + rpf += 5 + elif e.type == pygame.KEYDOWN: + if e.key == pygame.K_SPACE: + rpf *= -1 + if e.key == pygame.K_f: + if move: + scrn = pygame.display.set_mode((300, 300)) + move = False + x, y = (0, 0) + else: + scrn = pygame.display.set_mode((1280, 690)) + move = True + if e.key == pygame.K_j: + if img == 1: + mrJ = pygame.transform.scale(pygame.image.load('img/green.png'), (300, 300)) + img = 2 + elif img == 2: + mrJ = pygame.transform.scale(pygame.image.load('img/coday.png'), (300, 300)) + img = 3 + elif img == 3: + mrJ = pygame.transform.scale(pygame.image.load('img/mrj.png'), (300, 300)) + img = 1 + if e.key == pygame.K_h: + if show: + show = False + else: + show = True + elif e.type == pygame.MOUSEMOTION and move: + pos = e.pos + x = pos[0] - 150 + y = pos[1] - 150 + + scrn.fill(WHITE) + if show: + scrn.blit(font.render('Fullscreen/Move: f', True, BLACK), (5, 5)) + scrn.blit(font.render('Direction: space', True, BLACK), (5, 17)) + scrn.blit(font.render('Change Face: j', True, BLACK), (5, 29)) + scrn.blit(font.render('Quit: q', True, BLACK), (5, 41)) + scrn.blit(font.render('Hide: h', True, BLACK), (5, 53)) + rotated = pygame.transform.rotate(mrJ, rotation) + rotation += rpf + new_rect = rotated.get_rect(center=mrJ.get_rect(topleft=(x, y)).center) + scrn.blit(rotated, new_rect) + pygame.display.update() + clock.tick(60)