Step 6 of 12
Write settings.py
Open bobgame/settings.py and type this in
WIDTH = 800
HEIGHT = 600
FPS = 60
BG_COLOR = (30, 32, 38)
BOB_RADIUS = 20
BOB_SPEED = 250 # pixels per second
SKIN_COLOR = (233, 189, 150)
HAIR_COLOR = (70, 45, 25)
ARROW_COLOR = (240, 80, 60)
Each line is a variable: a name with a value stored in it, like a labelled box. We write the names in CAPITAL LETTERS because they are settings that never change while the game runs.
WIDTHandHEIGHTare the size of the window in pixels (the tiny dots your screen is made of).FPSis frames per second. A game is like a flipbook, it draws a new picture many times a second. 60 looks smooth.- Colours are three numbers: how much red, green and blue (0 to 255).
(0, 0, 0)is black,(255, 255, 255)is white, and(30, 32, 38)is a dark grey-blue. BOB_SPEEDis how many pixels Bob moves each second. The#starts a comment, a note for humans that Python ignores.
Try changing a colour later and see what happens. Pick colours with any "RGB colour picker" on the web.