bouncing_box.background module¶
A module that contains the class and functions for the Background.
-
class
Background(pos)¶ Bases:
objectThis class contains all of the functions and variables that is used by the Background.
-
dimensions= <Vector2(640, 480)>¶
-
draw(screen)¶ A function to draw the Background to the screen.
-
getDimensions()¶ The Background Dimensions getter.
- Returns
The Background’s dimensions.
- Return type
class:pygame.math.Vector2
-
getHeight()¶ The Background height getter.
- Returns
The Background’s height.
- Return type
float
-
getMoving()¶ The Background moving getter.
- Returns
If the Background’s moving.
- Return type
bool
-
getPos()¶ The Background position getter.
- Returns
The Background’s position.
- Return type
class:pygame.math.Vector2
-
getWidth()¶ The Background width getter.
- Returns
The Background’s width.
- Return type
float
-
getX()¶ The Background x position getter.
- Returns
The Background’s x position.
- Return type
float
-
getY()¶ The Background y position getter.
- Returns
The Background’s y position.
- Return type
float
-
setPos(pos)¶ The Background position setter.
- Parameters
pos (class:pygame.math.Vector2) – The new value of the Background’s position.
-
setX(x)¶ The Background x position setter.
- Parameters
x (float) – The new value of the Background’s x position.
-
setY(y)¶ The Background y position setter.
- Parameters
y (float) – The new value of the Background’s y position.
-
sprite= <Surface(640x480x32 SW)>¶
-
startBackgroundMoving()¶ A function to start the Background moving by setting the moving boolean to true.
-
stopBackgroundMoving()¶ A function to stop the Background from moving by setting the moving boolean to false.
-
update(dt)¶ A function to update the Background.
- Parameters
dt (float) – The delta time.
-
velocity= 500.0¶
-