bouncing_box.girder module

A module that contains the class and functions for the Girder.

class Girder(pos)

Bases: object

This class contains all of the functions and variables that is used by the Girder.

dimensions = <Vector2(80, 400)>
draw(screen)

A function to draw the Girder to the screen.

Parameters

screen (class pygame.Surface) – The screen to draw to.

getDimensions()

The Girder Dimensions getter.

Returns

The Girder’s dimensions.

Return type

class:pygame.math.Vector2

getHeight()

The Girder height getter.

Returns

The Girder’s height.

Return type

float

getMoving()

The Girder moving getter.

Returns

The Girder’s moving boolean.

Return type

bool

getPos()

The Girder position getter.

Returns

The Girder’s position.

Return type

class:pygame.math.Vector2

getScoreable()

The Girder scoreable getter.

Returns

If the Girder can be scored.

Return type

bool

getStatus()

The Girder status getter.

Returns

The Girder’s dead boolean.

Return type

bool

getWidth()

The Girder width getter.

Returns

The Girder’s width.

Return type

float

getX()

The Girder x position getter.

Returns

The Girder’s x position.

Return type

float

getY()

The Girder y position getter.

Returns

The Girder’s y position.

Return type

float

killGirder()

A function to set the as Girder dead by setting the dead boolean to true.

reviveGirder()

A function to set the as Girder alive by setting the dead boolean to false.

setPos(pos)

The Girder position setter.

Parameters

pos (class:pygame.math.Vector2) – The new value of the Girder’s position.

setScoreable(scoreable)

The Girder scoreable setter.

Parameters

scoreable (bool) – If the Girder can be scored.

setX(x)

The Girder x position setter.

Parameters

x (float) – The new value of the Girder’s x position.

setY(y)

The Girder y position setter.

Parameters

scoreable (float) – The new value of the Girder’s y position.

sprite = <Surface(80x400x32 SW)>
startGirderMoving()

A function to start the Girder moving by setting the moving boolean to true.

stopGirderMoving()

A function to stop the Girder from moving by setting the moving boolean to false.

update(dt)

A function to update the Girder.

Parameters

dt (float) – The delta time.

velocity = 700.0