Skip to main content

An easy to use game engine/framework for python.

Project description

ursina ʕ •ᴥ•ʔゝ□

Website | Discord | Twitter | Patreon | Sponsor

An easy to use game engine/framework for python.

Banner

Trailer

Getting Started

  1. Install Python 3.10 or newer.

  2. Open cmd/terminal and type:

pip install ursina

To get the newest, in development version from GitHub, install it like this:

pip install git+https://github.com/pokepetter/ursina.git

If you want to easily edit the source, it's recommended to clone the git repo and pip install with --editable flag like this. Make sure you have git installed.

git clone https://github.com/pokepetter/ursina.git
cd ursina
pip install --editable .

Also install any of the optional dependencies you want from the list below, or install them all with:

pip install ursina[extras]

On some systems you might have to use pip3 instead of pip in order to use Python 3 and not the old Python 2. To use a specific Python version, use:

python3.xx -m pip install ursina

Where 3.xx is the version you want to target.

Dependencies

  • python 3.10+
  • panda3d
  • pillow, for texture manipulation
  • psd-tools, for converting .psd files
  • blender, for converting .blend files
  • pyperclip, for copy/pasting

Examples

from ursina import *            # this will import everything we need from ursina with just one line.

app = Ursina()
ground = Entity(
    model = 'cube',
    color = color.magenta,
    z = -.1,
    y = -3,
    origin = (0, .5),
    scale = (50, 1, 10),
    collider = 'box',
    )

app.run()                       # opens a window and starts the game.

There are other examples in the samples folder, or in samples website

How do I make a game?

Ursina games are made by writing Python code. You can use any text editor you want, but personally I like to use Atom.

  1. Create an empty .py file called ursina_game.py
  2. Copy this text into your new file:
from ursina import *           # this will import everything we need from ursina with just one line.

app = Ursina()

player = Entity(
    model = 'cube' ,           # finds a 3d model by name
    color = color.orange,
    scale_y = 2
    )

def update():                  # update gets automatically called by the engine.
    player.x += held_keys['d'] * .1
    player.x -= held_keys['a'] * .1


app.run()                     # opens a window and starts the game.
  1. Run this in the terminal start the game:

    python ursina_game.py
    

    ... or run it with your editor/IDE of choice.

  2. You can now move the orange box around with 'a' and 'd'!

    To close the window, you can by default, press control+shift+alt+q or press the red x.

Documentation

Found a bug? Posting it in Issues. Fixed a bug? Make a pull request.

Project Structure

## Project Structure

📁docs
    📃index.txt
    📃documentation.txt
    📃inventory_tutorial.txt
    ...
        # text files for the website. gets turned into .html files with sswg.

    📃cheat_sheet.html
        # auto generated documentation made with documentation_generator.py.

    📃tutorial_generator.py
        # turns specific .py files into .txt files, which can then be turned into .html by sswg.
        # this extracts the comments from the source files into description for that step and the code after into code blocks.
        # see platformer_tutorial.py for an example.

📁samples               # small example games.

📁ursina                # the actual ursina module.
    📁audio                 # built-in audio clips.
    📁editor                # the 3d level editor for ursina.
    📁fonts                 # built-in fonts.
    📁models                # .blend files, source files, for built-in 3d models.
        📁procedural            # classes for generating 3d models, like Cylinder, Quad and Terrain.
    📁models_compressed     # .blend files converted to .ursinamesh.
    📁prefabs               # higher level classes like Draggable, Slider, Sprite, etc.

    📃__init__.py
    📃application.py
    📃audio.py
    ...
        # ursina base modules, like code for Entity, input_handler, Text, window and so on.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ursina-8.1.1.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ursina-8.1.1-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

Details for the file ursina-8.1.1.tar.gz.

File metadata

  • Download URL: ursina-8.1.1.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for ursina-8.1.1.tar.gz
Algorithm Hash digest
SHA256 2a0e2da927d9251074b438e5a7d60e072ec58ecd4e88d4753a435e4bb77524c1
MD5 da5b5ef3749ea499a1a4e5cd41aee4c3
BLAKE2b-256 bdd08f458609bee37d9d0686fa4088260c70398971da1c6de39335e8cd6f7e8d

See more details on using hashes here.

File details

Details for the file ursina-8.1.1-py3-none-any.whl.

File metadata

  • Download URL: ursina-8.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for ursina-8.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0636a682af53f44b0003efd7252452aa6d495e8987997d607b294a7f813d22b
MD5 8cdde7aa9d6d628a2f801648abc86cbb
BLAKE2b-256 e2f9e4aaa3b4507943f9561b6421be1701073e26a9f2a38e020807e3b7bd03b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page