Ursina Engine
This article does not have any sources. (December 2024) |
Overview[change]
The Ursina Engine is a framework that uses the Python language. It allows developers to create both 2D and 3D projects. It is mainly used to create games. It is free and is licensed under the MIT license. In addition to games, it can also be used to create apps and simulations. The engine is available for Windows, Linux, and Mac (not officially supported).
There is also a community-created Android port:
https://github.com/PaologGithub/UrsinaForMobile/
Installation[change]
Install the latest major version of ursina via the pip command:
pip install ursina
Install the latest version of ursina from GitHub:
pip install https://github.com/pokepetter/ursina/archive/master.zip
Keep in mind that installing from the latest GitHub version may introduce new features or changes that could potentially break existing code.
Features[change]
Structure:
A regular project contains these features:
<syntaxhighlight lang="python" line>
from ursina import *
app = Ursina() # Generates the Ursina window
def update(): # Function called every frame
...
def input(key): # Called when a key is pressed
...
app.run() # Creates the window
</syntaxhighlight>
Entities:
Ursina is an entity-based engine. An entity is a Python class that acts as an object in Ursina, similar to the GameObject in Unity.
It can have a position, a rotation, a scale, a model, a texture, a color, a shader, a parent, ...
Scripts apply a behavior to the entity.
Each entity can have its own update function, that is executed each frame and an input function (executed when a key is pressed).
More attributes of an entity are shown here: API Reference Entity Basics
Collisions and Colliders:
Ursina can handle collisions when a collider is applied to an entity.
Alternatively, the functions raycast
and boxcast
can be used.
Prefabs:
You can use ursina's prefabs. For example, there's a first person controller (from ursina.prefabs.first_person_controller import FirstPersonController
), a color picker (from ursina.prefabs.color_picker import ColorPicker
), a checkbox system (from ursina.prefabs.checkbox import CheckBox
), a screen recorder (from ursina.prefabs.video_recorder import VideoRecorder
), a particle system (from ursina.prefabs.particle_system import ParticleSystem
), a file browser (from ursina.prefabs.file_browser import FileBrowser
), a grid editor (from ursina.prefabs.grid_editor import GridEditor
), an ascii editor (from ursina.prefabs.ascii_editor import ASCIIEditor
), etc.
Other useful tools and features:
Networking:
Ursina has a built-in module networking module: from ursina.networking import *
Physics Engine:
Ursina has a built-in physics engine (from ursina.physics import *), yet not finished.
Level Editor (Beta Preview):
Ursina's level editor is currently in beta preview. Import it via:<syntaxhighlight lang="python" line>
from ursina import *
from ursina.editor.level_editor import LevelEditor
app = Ursina()
editor = LevelEditor()
app.run()
</syntaxhighlight>
The trailer is accessible here.
Notable Projects[change]
- Dustred by pokepetter (Petter Amland, ursina's creator). Here's the code: GitHub Code
or play it in the browser (web version created with taptapir*): Play Dustred.
- Phalanger by SLHIDE™. Play Phalanger (Android, requires creating an account on their website).
- Rally by Mandaw, Desktop Play Rally
And many more on Itch.io.
ㅤㅤ*engine created by ursina's developer for creating browser games
Fun facts[change]
• ursina is over 7 years old, its birthday is the 07/20/2017
• the old name for ursina's Entity was "Thing", see the GitHub edit history