bouncing_box.player module

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

class Player(pos)

Bases: object

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

dimensions = <Vector2(70, 70)>
draw(screen)

A function to draw the Player to the screen.

Parameters

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

getDimensions()

The Player Dimensions getter.

Returns

The Player’s dimensions.

Return type

class:pygame.math.Vector2

getHeight()

The Player height getter.

Returns

The Player’s height.

Return type

float

getPos()

The Player position getter.

Returns

The Player’s position.

Return type

class:pygame.math.Vector2

getWidth()

The Player width getter.

Returns

The Player’s width.

Return type

float

getX()

The Player x position getter.

Returns

The Player’s x position.

Return type

float

getY()

The Player y position getter.

Returns

The Player’s y position.

Return type

float

jump()

A function to make the player jump by setting the velocity to launch it up.

maxVelocity = 500.0
setPos(pos)

The Player position setter.

Parameters

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

setX(x)

The Player x position setter.

Parameters

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

setY(y)

The Player y position setter.

Parameters

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

sprite = <Surface(70x70x32 SW)>
update(dt)

A function to update the Player.

Parameters

dt (float) – The delta time.