diff --git a/README.md b/README.md index 58d0520..8eecbbe 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +# Notes +Still Work in progress! Use at own risk! + +
Install Setup
+``` +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) diff --git a/images/pic1.png b/images/pic1.png new file mode 100644 index 0000000..a5f7d01 Binary files /dev/null and b/images/pic1.png differ diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..2995aff --- /dev/null +++ b/src/__init__.py @@ -0,0 +1,3 @@ +""" + Module +""" diff --git a/src/__main__.py b/src/__main__.py new file mode 100644 index 0000000..4f3deae --- /dev/null +++ b/src/__main__.py @@ -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() diff --git a/src/app.py b/src/app.py new file mode 100644 index 0000000..bfcf18e --- /dev/null +++ b/src/app.py @@ -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() diff --git a/src/world.py b/src/world.py new file mode 100644 index 0000000..87b6af9 --- /dev/null +++ b/src/world.py @@ -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)