-
Notifications
You must be signed in to change notification settings - Fork 0
Standards and Conventions
For compliance of the rest of the codebase.
When a method or function requires geometric point as input, take in a tuple so as to make it easily extendable for higher-dimensions.
They will always be specified as (width, height) for sizes or (row, col) for actual coordinates.
An exemption is when the class/method requiring it already makes explicit assumptions on the dimensionality of data.
To lessen cognitive overload from vanilla PyGame, rectangles are always described as (upper_left_x, upper_left_y, block_width, block_height)
. Classes which abstract rectangles should provide a way to express/convert the abstractions into this form.
window
refers to a Pygame surface, specifically one returned by pygame.display.set_mode
.
screen
refers to an instance of components.core.GameScreen
.
If the order of the items does not matter return a set. Otherwise, return a tuple or a list. If modifications are not expected, prefer tuples over lists, especially if it is just a compilation of constant literals; this provides a speed advantage.