-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestWheel2.py
More file actions
42 lines (35 loc) · 1.25 KB
/
Copy pathtestWheel2.py
File metadata and controls
42 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python3.4
# Setup Python ----------------------------------------------- #
from pygame.locals import *
import pygame
import sys
# Setup pygame/window ---------------------------------------- #
mainClock = pygame.time.Clock()
pygame.init()
pygame.display.set_caption('game base')
screen = pygame.display.set_mode((500, 500), 0, 32)
# make sure you provide your own image
img = pygame.image.load('wheel_revA.png').convert()
img.set_colorkey((0, 0, 0))
angle = 0
# Loop ------------------------------------------------------- #
while True:
angle += 6
# Background --------------------------------------------- #
screen.fill((0, 50, 0))
mx, my = pygame.mouse.get_pos()
#img_copy = pygame.transform.rotate(img, angle)
screen.blit(img, (mx - int(img.get_width() / 2),
my - int(img.get_height() / 2)))
# Buttons ------------------------------------------------ #
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
if event.type == KEYDOWN:
if event.key == K_ESCAPE:
pygame.quit()
sys.exit()
# Update ------------------------------------------------- #
pygame.display.update()
mainClock.tick(60)