Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0-Official committed Apr 21, 2023
0 parents commit 923915d
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/MrJacksonSpinner.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Binary file added img/coday.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 img/green.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 img/mrj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 923915d

Please sign in to comment.