creative commons by-nc-sa us import randomsystimepygame from pygame locals import fps windowwidth windowheight flashspeed in milliseconds flashdelay in milliseconds buttonsize buttongapsize timeout seconds before game over if no button is pushed white ( black brightred ( red ( brightgreen green brightblue blue brightyellow ( yellow ( darkgray bgcolor black xmargin int((windowwidth ( buttonsizebuttongapsize ymargin int((windowheight ( buttonsizebuttongapsize rect objects for each of the four buttons yellowrect pygame rect(xmarginymarginbuttonsizebuttonsize bluerect pygame rect(xmargin buttonsize buttongapsizeymarginbuttonsizebuttonsize redrect pygame rect(xmarginymargin buttonsize buttongapsizebuttonsizebuttonsize greenrect pygame rect(xmargin buttonsize buttongapsizeymargin buttonsize buttongapsizebuttonsizebuttonsize def main() global fpsclockdisplaysurfbasicfontbeep beep beep beep pygame init( fpsclock pygame time clock( displaysurf pygame display set_mode((windowwidthwindowheight)