From 32df492d86ba6e4c2c783b082e8765e8dda3991d Mon Sep 17 00:00:00 2001 From: dimkauzh Date: Thu, 1 Feb 2024 15:57:24 +0100 Subject: [PATCH] Rename github, and some basic setup --- CONTRIBUTING.md | 2 +- README.md | 14 +++++++------- docs/index.md | 6 +++--- mkdocs.yml | 4 ++-- src/fusionengine/engine/nodes.py | 26 ++++++++++++++++++++++++++ src/fusionengine/engine/physics.py | 8 ++++++++ tests/performance.py | 27 +++++++++++++++++++++++++++ 7 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 src/fusionengine/engine/nodes.py create mode 100644 src/fusionengine/engine/physics.py create mode 100644 tests/performance.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7179ff..1903788 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ pip install --user pdm ``` PDM will manage everything for us, like virtual enviorments, packages and scripts. -Then, fork [the repository](https://github.com/fusionengine-org/fusion-engine) to your profile. +Then, fork [the repository](https://github.com/fusionengine-org/fusion) to your profile. Then, clone your forked github repository: ```bash diff --git a/README.md b/README.md index 492977a..fe40264 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ PyPI - License PyPI - Status PyPI - Downloads -GitHub contributors -Lines of code +GitHub contributors +Lines of code

@@ -49,7 +49,7 @@ if you want to install the package from source and get the latest changes then y ``` ### 🏃‍♂️ Run example -The examples are located [here](https://github.com/fusionengine-org/fusion-engine/tree/main/src/fusionengine/examples) +The examples are located [here](https://github.com/fusionengine-org/fusion/tree/main/src/fusionengine/examples) If you want to run the example, then follow these instructions: 1. First, make sure you have fusion engine installed. @@ -90,11 +90,11 @@ This project began May 1, 2023. The original project began in C, but it's entire ### ⭐ Star History - + - - - Star History Chart + + + Star History Chart diff --git a/docs/index.md b/docs/index.md index 2d0582d..f65853f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ hide: ---

- logo + logo

@@ -15,8 +15,8 @@ hide: PyPI - License PyPI - Status PyPI - Downloads -GitHub contributors -Lines of code +GitHub contributors +Lines of code

diff --git a/mkdocs.yml b/mkdocs.yml index 7497e96..a33380c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,8 +1,8 @@ site_name: Fusion Engine Documentation site_description: A custom open-source game engine on OpenGL and Python, it’s written in pure Python! It’s easy and fast! -repo_name: fusion-engine -repo_url: https://github.com/fusionengine-org/fusion-engine +repo_name: fusionengine-org/fusion +repo_url: https://github.com/fusionengine-org/fusion nav: - Home: 'index.md' diff --git a/src/fusionengine/engine/nodes.py b/src/fusionengine/engine/nodes.py new file mode 100644 index 0000000..54a9700 --- /dev/null +++ b/src/fusionengine/engine/nodes.py @@ -0,0 +1,26 @@ +from fusionengine.engine.physics import Staticbody +from fusionengine.engine.vector import Vector2D + + +class Node: + def __init__( + self, + x: int, + y: int, + node_type, + body_type=Staticbody, + ): + self.x = x + self.y = y + self.x = node_type.x + self.y = node_type.y + self.body_type = body_type + self.node_type = node_type + + pass + + def get_coord_tuple(self) -> tuple[int, int]: + return self.x, self.y + + def get_vec2_coord(self) -> Vector2D: + return Vector2D(self.x, self.y) diff --git a/src/fusionengine/engine/physics.py b/src/fusionengine/engine/physics.py new file mode 100644 index 0000000..35f56a9 --- /dev/null +++ b/src/fusionengine/engine/physics.py @@ -0,0 +1,8 @@ +class Rigidbody: + def __init__(self): + pass + + +class Staticbody: + def __init__(self): + pass diff --git a/tests/performance.py b/tests/performance.py new file mode 100644 index 0000000..35f5d5e --- /dev/null +++ b/tests/performance.py @@ -0,0 +1,27 @@ +import fusionengine as fusion +import time + +checked_time = False +start_time = time.time() + +window = fusion.Window("test", 600, 600) + + +if fusion.__version__ == "5.1.0" or fusion.__version__ == "5.0.0": + image = fusion.Image(fusion.DEBUGIMAGE, 0, 0, 600, 600) + +else: + image = fusion.Image(window, fusion.DEBUGIMAGE, 0, 0, 600, 600) + + +@window.loop +def loop(): + global checked_time + image.draw() + + if not checked_time: + end_time = time.time() + elapsed_time = end_time - start_time + + print(elapsed_time) + checked_time = True