An easy to use game engine/framework for python.
Project description
ursina ʕ •ᴥ•ʔゝ□
An easy to use game engine/framework for python.
Getting Started
- Install Python 3.6 or newer. https://www.python.org/downloads/
- Open cmd/terminal and type:
pip install ursina
If you want to install the newest version from git, you can install 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 install as develop like this. Make sure you have git installed. https://git-scm.com/
git clone https://github.com/pokepetter/ursina.git
python setup.py develop
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.
Dependencies
- python 3.6+
- 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.
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.
- Create an empty .py file called
ursina_game.py
- 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.
-
Type this in the terminal to start the game:
python ursina_game.py
If you use Atom, I recommend installing the package atom-python-run to run your scripts with the press of a button.
-
You can now move the orange box around with 'a' and 'd'!
To close the window, you can by default, press shift+q or press the red x. to disable this, write
window.exit_button.enabled = False
somewhere in your code.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ursina-7.0.0.tar.gz
.
File metadata
- Download URL: ursina-7.0.0.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 838970dadcd4b40d77b4d5c80ab2c99fc869d2b455de75b733b0f1f74a8874d1 |
|
MD5 | abecfc3d97f438fc2017c0c015396e8e |
|
BLAKE2b-256 | ff1376ff76de0839c68e58a6a927438778b98c7ca7f38dce517e359a3721498e |
File details
Details for the file ursina-7.0.0-py3-none-any.whl
.
File metadata
- Download URL: ursina-7.0.0-py3-none-any.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f80a8ee84c299b835075d37780fd4607bd20cf85f9dacc59376d9535b51bb7c3 |
|
MD5 | a32868da0aea1fa535e1490fd4f41aa1 |
|
BLAKE2b-256 | 0579f2d8d88adc8cfc86da15ab6ac8f9f4670d5367b6bf94642ffe0ebec4d963 |