Answers
Exercise A:
screen.set_at((x, y), pygame.Color(0, int(x/1000 * 255),
int(y/800 * 255)))
Exercise B:
y = 8x + 0.5
Exercise C:
For another line of text with a different font, you will need to declare two fonts and two texts like this:
font1 = pygame.font.Font('fonts/Authentic Sheldon.ttf', 120)
font2 = pygame.font.Font('fonts/PinkChicken-Regular.ttf', 120)
text1 = font1.render('Penny de Byl', False, white)
text2 = font2.render('Another line of text', False, white)
Then, inside the while
loop, blit both:
screen.blit(text1, (10, 10))
screen.blit(text2, (10, 100))
Exercise D:
import pygame
from pygame.locals import *
pygame.init()
screen_width = 800
screen_height = 800
screen = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption('Triangle Clicker')
done = False...