changes to orientation and colour
This commit is contained in:
parent
7048bc3800
commit
da2f53a5a3
23
gametest.py
23
gametest.py
@ -36,7 +36,7 @@ whiteColor = pygame.Color(255, 255, 255)
|
||||
yellowColor = pygame.Color(255, 215, 0)
|
||||
grayColor = pygame.Color(196, 202, 206)
|
||||
brownColor = pygame.Color(177, 86, 15)
|
||||
mainFontColor = whiteColor
|
||||
mainFontColor = blackColor
|
||||
|
||||
#fonts
|
||||
font1 = pygame.font.Font('freesansbold.ttf', 90)
|
||||
@ -126,9 +126,9 @@ def change_led_colour(red_amount,green_amount,blue_amount):
|
||||
if red_amount < 0 or red_amount > 255 or green_amount < 0 or green_amount > 255 or blue_amount < 0 or blue_amount > 255:
|
||||
led_alert()
|
||||
return false
|
||||
red.ChangeDutyCycle(red_amount)
|
||||
blue.ChangeDutyCycle(blue_amount)
|
||||
green.ChangeDutyCycle(green_amount)
|
||||
change_red(red_amount)
|
||||
change_blue(blue_amount)
|
||||
change_green(green_amount)
|
||||
|
||||
def change_led_speed(colour, speed):
|
||||
#changes the speed of the LED pwm
|
||||
@ -307,8 +307,9 @@ led_init()
|
||||
|
||||
while True: # main loop
|
||||
#global label storage
|
||||
clearScreen()
|
||||
print("New game starting")
|
||||
change_led_colour(10,100,10)
|
||||
change_led_colour(10,140,10)
|
||||
time_surface = 0
|
||||
errors_surface = 0
|
||||
time_rectangle = 0
|
||||
@ -316,23 +317,25 @@ while True: # main loop
|
||||
|
||||
header_surface = font1.render('Dr' + u'ü' + 'cken Sie Start!', True, mainFontColor)
|
||||
header_rectangle = header_surface.get_rect()
|
||||
header_rectangle.topleft = (580, 280)
|
||||
header_rectangle.topleft = (560, 250)
|
||||
|
||||
highscore_header_surface = font2.render('Highscores:', True, mainFontColor)
|
||||
highscore_header_rectangle = highscore_header_surface.get_rect()
|
||||
highscore_header_rectangle = (680, 410)
|
||||
highscore_header_rectangle = (770, 410)
|
||||
|
||||
score1_surface = font3.render(hs1_name + ": " + str(hs1_time) + 's', True, yellowColor)
|
||||
score1_rectangle = score1_surface.get_rect()
|
||||
score1_rectangle.topleft = (720, 520)
|
||||
score1_rectangle.topleft = (820, 540)
|
||||
|
||||
score2_surface = font3.render(hs2_name + ": " + str(hs2_time) + 's', True, grayColor)
|
||||
score2_rectangle = score2_surface.get_rect()
|
||||
score2_rectangle.topleft = (720, 610)
|
||||
score2_rectangle.topleft = (820, 630)
|
||||
|
||||
score3_surface = font3.render(hs3_name + ": " + str(hs3_time) + 's', True, brownColor)
|
||||
score3_rectangle = score3_surface.get_rect()
|
||||
score3_rectangle.topleft = (720, 700)
|
||||
score3_rectangle.topleft = (820, 720)
|
||||
|
||||
pygame.draw.rect(screen,blackColor, (500, 200, (screenSizeX-500*2), (screenSizeY-200*2)), 5)
|
||||
|
||||
screen.blit(header_surface, header_rectangle)
|
||||
screen.blit(highscore_header_surface, highscore_header_rectangle)
|
||||
|
Loading…
Reference in New Issue
Block a user