Core

App

__init__(width : int, height : int, title : str, |OPTIONAL| flags : int <0>, fps : float <60>, exit_key : int <pygame.K_ESCAPE>)
Variables
gravity       : float <9.807>
physics_color : tuple <(255,255,255)>
exit_key      : int
window        : godity.core.Window
Methods
#overwrite methods
start()
update()
render()
end()
loadImage(name : str, path : str, |OPTIONAL| convert_alpha : bool <False>)
getImage(name : str) -> pygame.Surface
updateImage(name : str, path : str, |OPTIONAL| convert_alpha : bool <False>)
deleteImage(name : str)
loadAudio(name : str, path : str)
getAudio(name : str) -> pygame.mixer.Sound
playAudio(name : str)
stopAudio(name : str)
deleteAudio(name : str)
getEvents() -> list
getClock() -> pygame.time.Clock()
getFlags() -> int
getDeltaTime() -> float
getScene() -> godity.core.Scene
setFps(value : float)
close()
run()

Component

__init__(name : str, args : dict)
Variables
name   : str
args   : dict
entity : godity.core.Entity <None>
Methods
start()
update()

Entity

__init__(name : str)
Variables
name      : str
childrens : list
layer     : godity.core.Layer <None>
Scene     : godity.core.Scene <None>
Methods
add(component : godity.core.Component)
remove(component : str)
has(component : str)
get(component : str)
addTag(name : str)
removeTag(name : str)
hasTag(name : str)
parent(entity : godity.core.Entity, |OPTIONAL| offset_x : int <0>, offset_y : int <0>)
clearParent()
getChildrens()
getLayer()
getScene()
update()
end()

Layer

__init__(name : str)
Variables
name : str
Methods
add(entity : godity.core.Entity)
remove(entity : str)
getEntities() -> list
getEntitiesWithComponent(component : str) -> list

Scene

__init__(app : godity.core.App, name : str, surface_width : int, surface_height : int, |OPTIONAL| adjust_surface : bool <True>, render_physics : bool <False>, environment_light : tuple <(255,255,255)>, max_surface_width : int <None>, max_surface_height : int <None>)
Variables
name              : str
render_physics    : bool
environment_light : tuple
background_color  : tuple <(0,0,0)>
Methods
addLayer(layer : godity.core.Layer)
removeLayer(layer : str)
add(entity : godity.core.Entity, layer : godity.core.Layer)
remove(entity : str, layer : str)
get(entity : str) -> godity.core.Entity
getEntities() -> list
getEntitiesWithComponent(component : str) -> list
getSurface() -> pygame.Surface
getCamera() -> godity.core.Entity
setCamera(entity : godity.core.Entity)
# the entity must have a camera component.
isRendering() -> bool
isUpdating() -> bool
render()
update()

Timer

__init__()
Variables
last_time : float
Methods
getTime() -> float
resetTime()

Window

__init__(width : int, height : int, title : str, |OPTIONAL| flags : int <0>)
Variables
width  : int
height : int
title  : str
flags  : int
Methods
getDisplay() -> pygame.Surface
clearColor(color : tuple)
update()