Module that renders graphics to screen.

class xoinvader.render.Renderable[source]

Base for renderable objects.

get_render_data(None) -> (gpos_list, data_gen)[source]

Every renderable object must return tuple consist of: * gpos_list: list of every Surface’s global positions (List of Points)

Example: [Point(x=5, y=5), Point(x=10, y=10)]
  • data_gen: generator which yields tuple (lpos, image, style) Example: (Point(x=5, y=5), “*”, curses.A_BOLD)
remove_obsolete(Point(int, int)) → None[source]

Every renderable object must remove old bullets that places behind border (field for rendering).

If object will never change its coordinates it may not implement this method.

render_priority = 0
class xoinvader.render.Renderer(border)[source]

Handles collection of renderable objects, renders them to screen.


Add renderable object.


Remove renderable object.


Render all renderable objects.

xoinvader.render.render_objects(objects, screen)[source]

Render all renderable objects.