Welcome Installation Getting Started User Interaction Build a Game #1 Build a Game #2 Build a Game #3 Colours Coordinates API Reference Globals Window Camera Mouse Key Rect Image Text Shape Line Screen Sound Base

Globals

Welcome to the API Reference, a technical overview of every JoBase feature.

Objects

These are globals that control the window, and handle user input.

  • window

    Manage the main window

  • camera

    Control the rendering of things

  • mouse

    Handle cursor input

  • key

    Handle keyboard input

Classes

Functions

run() -> None

Run the main game loop. If your file contains a def loop() function, it will be called continuously.

random(x = float, y = 1) -> float

Find a random float between x and y.

  • x: float

    The starting limit of the random number

  • y: float

    The end limit of the random number

Colours

JoBase supports a set of default colours. Learn how to create your own.

WHITE = 1, 1, 1
BLACK = 0, 0, 0
GRAY = 0.5, 0.5, 0.5
DARK_GRAY = 0.2, 0.2, 0.2
LIGHT_GRAY = 0.8, 0.8, 0.8
BROWN = 0.6, 0.2, 0.2
TAN = 0.8, 0.7, 0.6
RED = 1, 0, 0
DARK_RED = 0.6, 0, 0
SALMON = 1, 0.5, 0.5
ORANGE = 1, 0.5, 0
GOLD = 1, 0.8, 0
YELLOW = 1, 1, 0
OLIVE = 0.5, 0.5, 0
LIME = 0, 1, 0
DARK_GREEN = 0, 0.4, 0
GREEN = 0, 0.5, 0
AQUA = 0, 1, 1
BLUE = 0, 0, 1
LIGHT_BLUE = 0.5, 0.8, 1
AZURE = 0.9, 1, 1
NAVY = 0, 0, 0.5
PURPLE = 0.5, 0, 1
PINK = 1, 0.75, 0.8
MAGENTA = 1, 0, 1

Fonts

  • DEFAULT

    Default sans serif font. Passed to Text.font.

  • CODE

    A monospace font. Passed to Text.font.

  • SERIF

    A serif font. Passed to Text.font.

  • DISPLAY

    A display font. Passed to Text.font.

  • PIXEL

    A pixel font. Passed to Text.font.

Images

Sounds

  • PICKUP

    Default sound effect. Passed to Sound.

  • BLIP

    Passed to Sound.

Coordinates Window