Initial push...

This commit is contained in:
itdominator 2022-11-12 22:06:15 -06:00
parent 1198b6b876
commit 5729caad45
6 changed files with 95 additions and 1 deletions

View File

@ -1,3 +1,18 @@
# Ursina-Template
Ursina-Template is an Ursina Game Engine Template project to get started more easily
Ursina-Template is an Ursina Game Engine Template project to get started more easily.
# Notes
<b>Still Work in progress! Use at own risk!</b>
<h6>Install Setup</h6>
```
sudo apt-get install python3.8 python3-setproctitle
python -m pip install ursina
```
# TODO
...
# Images
![1 Ursina single purple cube in void world. ](images/pic1.png)

BIN
images/pic1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

3
src/__init__.py Normal file
View File

@ -0,0 +1,3 @@
"""
Module
"""

41
src/__main__.py Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/python3
# Python imports
import argparse, faulthandler, traceback
from setproctitle import setproctitle
# Lib imports
# Application imports
from app import Application
def run():
try:
setproctitle('Ursina Game')
faulthandler.enable() # For better debug info
parser = argparse.ArgumentParser()
# Add long and short arguments
parser.add_argument("--debug", "-d", default="false", help="Do extra console messaging.")
parser.add_argument("--trace-debug", "-td", default="false", help="Disable saves, ignore IPC lock, do extra console messaging.")
parser.add_argument("--no-plugins", "-np", default="false", help="Do not load plugins.")
parser.add_argument("--new-tab", "-t", default="", help="Open a file into new tab.")
parser.add_argument("--new-window", "-w", default="", help="Open a file into a new window.")
# Read arguments (If any...)
args, unknownargs = parser.parse_known_args()
app = Application(args, unknownargs)
app.run()
except Exception as e:
traceback.print_exc()
quit()
if __name__ == "__main__":
''' Set process title, get arguments, and create Ursina main thread. '''
run()

17
src/app.py Normal file
View File

@ -0,0 +1,17 @@
# Python imports
# Lib imports
from ursina import *
# from ursina import Ursina
# Application imports
from world import World
class Application(Ursina):
""" docstring for Application. """
def __init__(self, args, unknownargs):
super(Application, self).__init__(size = (800, 600))
World()

18
src/world.py Normal file
View File

@ -0,0 +1,18 @@
# Python imports
# Lib imports
from ursina import *
# Application imports
class World():
""" docstring for World. """
def __init__(self):
self.cube = Entity(model='cube', color=hsv(300,1,1), scale=2, collider='box')
self.cube.on_click = self.spin
EditorCamera() # add camera controls for orbiting and moving the camera
def spin(self):
self.cube.animate('rotation_y', self.cube.rotation_y+360, duration=2, curve=curve.in_out_expo)