Skip to content

Commit

Permalink
Updated documentation and fixed bugs (and file structure)
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah-Ribbens committed Jan 3, 2024
1 parent e7a108b commit b6417a9
Show file tree
Hide file tree
Showing 95 changed files with 383 additions and 163 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.idea
*/.idea
test.py
*__pycache__*
TODO.md
*pong_reloaded_remastered*
.DS_Store
../docs/_build/
../docs/_static/
../docs/_templates
dist
19 changes: 19 additions & 0 deletions LISCENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2018 The Python Packaging Authority

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 0 additions & 2 deletions docs/base/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ <h1 class="title">Module <code>game_qu.base.events</code></h1>
<pre><code class="python">from game_qu.base.history_keeper import HistoryKeeper
from game_qu.base.id_creator import id_creator
from game_qu.base.timed_event import TimedEvent
from game_qu.base.count_event import CountEvent


class Event:
&#34;&#34;&#34;Used to store an event from the current cycle and past cycles (event being anything that is a bool)&#34;&#34;&#34;
Expand Down
4 changes: 1 addition & 3 deletions docs/base/game_movement.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ <h1 class="title">Module <code>game_qu.base.game_movement</code></h1>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">import pygame.key

from game_qu.base.important_variables import SCREEN_HEIGHT, SCREEN_LENGTH
<pre><code class="python">from game_qu.base.important_variables import SCREEN_HEIGHT, SCREEN_LENGTH
from game_qu.base.utility_functions import key_is_pressed
from game_qu.base.velocity_calculator import VelocityCalculator

Expand Down
1 change: 0 additions & 1 deletion docs/base/important_variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ <h1 class="title">Module <code>game_qu.base.important_variables</code></h1>
from game_qu.base.keyboard import Keyboard
from game_qu.gui_components.window import Window
from game_qu.library_abstraction import keys
from game_qu.base.colors import *

keyboard = Keyboard()
game_window = Window(SCREEN_LENGTH, SCREEN_HEIGHT, BACKGROUND_COLOR, &#34;Game Basics&#34;)
Expand Down
3 changes: 2 additions & 1 deletion docs/base/keyboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ <h1 class="title">Module <code>game_qu.base.keyboard</code></h1>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">from game_qu.base.events import Event, TimedEvent
<pre><code class="python">from game_qu.base.events import Event
from game_qu.base.timed_event import TimedEvent
from game_qu.library_abstraction import keys
from game_qu.library_abstraction import utility_functions
from game_qu.library_abstraction import variables
Expand Down
8 changes: 1 addition & 7 deletions docs/base/quadratic_equations.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ <h1 class="title">Module <code>game_qu.base.quadratic_equations</code></h1>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">import math

from game_qu.base.important_variables import SCREEN_HEIGHT
from game_qu.base.utility_functions import get_kwarg_item, solve_quadratic
from game_qu.base.velocity_calculator import VelocityCalculator
from game_qu.math.function import Function
from game_qu.math.physics_function import PhysicsFunction
<pre><code class="python">from game_qu.math.physics_function import PhysicsFunction
from game_qu.math.quadratic_function import QuadraticFunction
from game_qu.paths.physics_followable_path import PhysicsFollowablePath

Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 class="section-title" id="header-submodules">Sub-modules</h2>
This game engine is compartmentalized. There is almost total freedom for making games with this engine.
Components like collision detection, …</p></div>
</dd>
<dt><code class="name"><a title="game_qu.getting_started.pong (example game)" href="pong%20(example%20game).html">game_qu.getting_started.pong (example game)</a></code></dt>
<dt><code class="name"><a title="game_qu.getting_started.pong (example game)" href="pong (example game).html">game_qu.getting_started.pong (example game)</a></code></dt>
<dd>
<div class="desc"><p>This is an example of a simple game of pong made using the game engine. Click the see 'Expand Source Code' button below
to see the code.</p></div>
Expand Down Expand Up @@ -60,7 +60,7 @@ <h1>Index</h1>
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
<ul>
<li><code><a title="game_qu.getting_started.getting_started" href="getting_started.html">game_qu.getting_started.getting_started</a></code></li>
<li><code><a title="game_qu.getting_started.pong (example game)" href="pong%20(example%20game).html">game_qu.getting_started.pong (example game)</a></code></li>
<li><code><a title="game_qu.getting_started.pong (example game)" href="pong (example game).html">game_qu.getting_started.pong (example game)</a></code></li>
</ul>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/gui_components/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 class="title">Module <code>game_qu.gui_components.button</code></h1>
<span>Expand source code</span>
</summary>
<pre><code class="python">from game_qu.gui_components.text_box import TextBox
from game_qu.base.events import TimedEvent
from game_qu.base.timed_event import TimedEvent


class Button(TextBox):
Expand Down
19 changes: 14 additions & 5 deletions docs/gui_components/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ <h1 class="title">Module <code>game_qu.gui_components.component</code></h1>
def __init__(self, path_to_image=&#34;&#34;):
&#34;&#34;&#34;Initializes the object and loads an image if the path_to_image is not empty&#34;&#34;&#34;

super().__init__(self.left_edge, self.top_edge, self.length, self.height)

self.path_to_image = path_to_image

if path_to_image != &#34;&#34;:
Expand Down Expand Up @@ -117,7 +119,7 @@ <h1 class="title">Module <code>game_qu.gui_components.component</code></h1>
&#34;&#34;&#34;Sets the functions that are called when the mouse enters and exits the component&#34;&#34;&#34;

self.set_mouse_enter_function(mouse_enter_function)
self.mouse_exit_function(mouse_exit_function)
self.set_mouse_exit_function(mouse_exit_function)

def set_mouse_enter_function(self, mouse_enter_function):
&#34;&#34;&#34;Sets the action that happens when a mouse enters this object&#34;&#34;&#34;
Expand Down Expand Up @@ -182,6 +184,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
def __init__(self, path_to_image=&#34;&#34;):
&#34;&#34;&#34;Initializes the object and loads an image if the path_to_image is not empty&#34;&#34;&#34;

super().__init__(self.left_edge, self.top_edge, self.length, self.height)

self.path_to_image = path_to_image

if path_to_image != &#34;&#34;:
Expand Down Expand Up @@ -242,7 +246,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
&#34;&#34;&#34;Sets the functions that are called when the mouse enters and exits the component&#34;&#34;&#34;

self.set_mouse_enter_function(mouse_enter_function)
self.mouse_exit_function(mouse_exit_function)
self.set_mouse_exit_function(mouse_exit_function)

def set_mouse_enter_function(self, mouse_enter_function):
&#34;&#34;&#34;Sets the action that happens when a mouse enters this object&#34;&#34;&#34;
Expand All @@ -269,8 +273,13 @@ <h3>Ancestors</h3>
</ul>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="game_qu.getting_started.pong (example game).Ball" href="../getting_started/pong%20(example%20game).html#game_qu.getting_started.pong (example game).Ball">Ball</a></li>
<li><a title="game_qu.getting_started.pong (example game).Player" href="../getting_started/pong%20(example%20game).html#game_qu.getting_started.pong (example game).Player">Player</a></li>
<li><a title="Game-Qu.src.game_qu.getting_started.pong (example game).Ball" href="../../Game-Qu/src/game_qu/getting_started/pong (example game).html#Game-Qu.src.game_qu.getting_started.pong (example game).Ball">Ball</a></li>
<li><a title="Game-Qu.src.game_qu.getting_started.pong (example game).Player" href="../../Game-Qu/src/game_qu/getting_started/pong (example game).html#Game-Qu.src.game_qu.getting_started.pong (example game).Player">Player</a></li>
<li><a title="Game-Qu.src.game_qu.gui_components.hud.HUD" href="../../Game-Qu/src/game_qu/gui_components/hud.html#Game-Qu.src.game_qu.gui_components.hud.HUD">HUD</a></li>
<li><a title="Game-Qu.src.game_qu.gui_components.screen.Screen" href="../../Game-Qu/src/game_qu/gui_components/screen.html#Game-Qu.src.game_qu.gui_components.screen.Screen">Screen</a></li>
<li><a title="Game-Qu.src.game_qu.gui_components.text_box.TextBox" href="../../Game-Qu/src/game_qu/gui_components/text_box.html#Game-Qu.src.game_qu.gui_components.text_box.TextBox">TextBox</a></li>
<li><a title="game_qu.getting_started.pong (example game).Ball" href="../getting_started/pong (example game).html#game_qu.getting_started.pong (example game).Ball">Ball</a></li>
<li><a title="game_qu.getting_started.pong (example game).Player" href="../getting_started/pong (example game).html#game_qu.getting_started.pong (example game).Player">Player</a></li>
<li><a title="game_qu.gui_components.hud.HUD" href="hud.html#game_qu.gui_components.hud.HUD">HUD</a></li>
<li><a title="game_qu.gui_components.screen.Screen" href="screen.html#game_qu.gui_components.screen.Screen">Screen</a></li>
<li><a title="game_qu.gui_components.text_box.TextBox" href="text_box.html#game_qu.gui_components.text_box.TextBox">TextBox</a></li>
Expand Down Expand Up @@ -520,7 +529,7 @@ <h3>Methods</h3>
&#34;&#34;&#34;Sets the functions that are called when the mouse enters and exits the component&#34;&#34;&#34;

self.set_mouse_enter_function(mouse_enter_function)
self.mouse_exit_function(mouse_exit_function)</code></pre>
self.set_mouse_exit_function(mouse_exit_function)</code></pre>
</details>
</dd>
</dl>
Expand Down
1 change: 1 addition & 0 deletions docs/gui_components/dimensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
</details>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="Game-Qu.src.game_qu.gui_components.component.Component" href="../../Game-Qu/src/game_qu/gui_components/component.html#Game-Qu.src.game_qu.gui_components.component.Component">Component</a></li>
<li><a title="game_qu.gui_components.component.Component" href="component.html#game_qu.gui_components.component.Component">Component</a></li>
</ul>
<h3>Class variables</h3>
Expand Down
4 changes: 4 additions & 0 deletions docs/gui_components/hud.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ <h1 class="title">Module <code>game_qu.gui_components.hud</code></h1>
Returns:
None
&#34;&#34;&#34;

super().__init__(&#34;&#34;)

self.player_points_fields = []
self.rows = rows
Expand Down Expand Up @@ -176,6 +178,8 @@ <h2 id="returns">Returns</h2>
Returns:
None
&#34;&#34;&#34;

super().__init__(&#34;&#34;)

self.player_points_fields = []
self.rows = rows
Expand Down
2 changes: 1 addition & 1 deletion docs/gui_components/intermediate_screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1 class="title">Module <code>game_qu.gui_components.intermediate_screen</code>
<pre><code class="python">from game_qu.base.colors import white
from game_qu.base.utility_functions import get_index_of_range, get_ranges
from game_qu.gui_components.dimensions import Dimensions
from game_qu.base.events import TimedEvent
from game_qu.base.timed_event import TimedEvent
from game_qu.base.important_variables import BACKGROUND_COLOR, SCREEN_LENGTH, SCREEN_HEIGHT
from game_qu.gui_components.screen import Screen
from game_qu.gui_components.text_box import TextBox
Expand Down
12 changes: 11 additions & 1 deletion docs/gui_components/screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ <h1 class="title">Module <code>game_qu.gui_components.screen</code></h1>
&#34;&#34;&#34; Initializes the object and also loads the image which is at the path &#39;path_to_background_image.&#39; No image will
be loaded if path_to_background_image is &#39;&#39;&#34;&#34;&#34;

super().__init__(&#34;&#34;)

self.path_to_background_image = path_to_background_image
self.background_color = background_color

Expand Down Expand Up @@ -139,6 +141,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
&#34;&#34;&#34; Initializes the object and also loads the image which is at the path &#39;path_to_background_image.&#39; No image will
be loaded if path_to_background_image is &#39;&#39;&#34;&#34;&#34;

super().__init__(&#34;&#34;)

self.path_to_background_image = path_to_background_image
self.background_color = background_color

Expand Down Expand Up @@ -197,10 +201,16 @@ <h3>Ancestors</h3>
</ul>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="Game-Qu.src.game_qu.getting_started.getting_started.Game1Screen" href="../../Game-Qu/src/game_qu/getting_started/getting_started.html#Game-Qu.src.game_qu.getting_started.getting_started.Game1Screen">Game1Screen</a></li>
<li><a title="Game-Qu.src.game_qu.getting_started.getting_started.Game2Screen" href="../../Game-Qu/src/game_qu/getting_started/getting_started.html#Game-Qu.src.game_qu.getting_started.getting_started.Game2Screen">Game2Screen</a></li>
<li><a title="Game-Qu.src.game_qu.getting_started.getting_started.MainScreen" href="../../Game-Qu/src/game_qu/getting_started/getting_started.html#Game-Qu.src.game_qu.getting_started.getting_started.MainScreen">MainScreen</a></li>
<li><a title="Game-Qu.src.game_qu.getting_started.pong (example game).MainScreen" href="../../Game-Qu/src/game_qu/getting_started/pong (example game).html#Game-Qu.src.game_qu.getting_started.pong (example game).MainScreen">MainScreen</a></li>
<li><a title="Game-Qu.src.game_qu.gui_components.intermediate_screen.IntermediateScreen" href="../../Game-Qu/src/game_qu/gui_components/intermediate_screen.html#Game-Qu.src.game_qu.gui_components.intermediate_screen.IntermediateScreen">IntermediateScreen</a></li>
<li><a title="Game-Qu.src.game_qu.gui_components.navigation_screen.NavigationScreen" href="../../Game-Qu/src/game_qu/gui_components/navigation_screen.html#Game-Qu.src.game_qu.gui_components.navigation_screen.NavigationScreen">NavigationScreen</a></li>
<li><a title="game_qu.getting_started.getting_started.Game1Screen" href="../getting_started/getting_started.html#game_qu.getting_started.getting_started.Game1Screen">Game1Screen</a></li>
<li><a title="game_qu.getting_started.getting_started.Game2Screen" href="../getting_started/getting_started.html#game_qu.getting_started.getting_started.Game2Screen">Game2Screen</a></li>
<li><a title="game_qu.getting_started.getting_started.MainScreen" href="../getting_started/getting_started.html#game_qu.getting_started.getting_started.MainScreen">MainScreen</a></li>
<li><a title="game_qu.getting_started.pong (example game).MainScreen" href="../getting_started/pong%20(example%20game).html#game_qu.getting_started.pong (example game).MainScreen">MainScreen</a></li>
<li><a title="game_qu.getting_started.pong (example game).MainScreen" href="../getting_started/pong (example game).html#game_qu.getting_started.pong (example game).MainScreen">MainScreen</a></li>
<li><a title="game_qu.gui_components.intermediate_screen.IntermediateScreen" href="intermediate_screen.html#game_qu.gui_components.intermediate_screen.IntermediateScreen">IntermediateScreen</a></li>
<li><a title="game_qu.gui_components.navigation_screen.NavigationScreen" href="navigation_screen.html#game_qu.gui_components.navigation_screen.NavigationScreen">NavigationScreen</a></li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion docs/gui_components/text_box.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ <h1 class="title">Module <code>game_qu.gui_components.text_box</code></h1>
<span>Expand source code</span>
</summary>
<pre><code class="python">from game_qu.gui_components.dimensions import Dimensions
from game_qu.base.important_variables import game_window
from game_qu.gui_components.component import Component
from game_qu.base.utility_functions import *


class TextBox(Component):
&#34;&#34;&#34;A box that contains text. The background color, text color, text, font_size, and the text being centered can all be set&#34;&#34;&#34;

Expand Down Expand Up @@ -214,6 +214,7 @@ <h3>Ancestors</h3>
</ul>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="Game-Qu.src.game_qu.gui_components.button.Button" href="../../Game-Qu/src/game_qu/gui_components/button.html#Game-Qu.src.game_qu.gui_components.button.Button">Button</a></li>
<li><a title="game_qu.gui_components.button.Button" href="button.html#game_qu.gui_components.button.Button">Button</a></li>
</ul>
<h3>Class variables</h3>
Expand Down
5 changes: 5 additions & 0 deletions docs/math/function.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ <h3>Ancestors</h3>
</ul>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="Game-Qu.src.game_qu.math.bounded_function.BoundedFunction" href="../../Game-Qu/src/game_qu/math/bounded_function.html#Game-Qu.src.game_qu.math.bounded_function.BoundedFunction">BoundedFunction</a></li>
<li><a title="Game-Qu.src.game_qu.math.linear_interpolation.LinearInterpolation" href="../../Game-Qu/src/game_qu/math/linear_interpolation.html#Game-Qu.src.game_qu.math.linear_interpolation.LinearInterpolation">LinearInterpolation</a></li>
<li><a title="Game-Qu.src.game_qu.math.piecewise_function.PiecewiseFunction" href="../../Game-Qu/src/game_qu/math/piecewise_function.html#Game-Qu.src.game_qu.math.piecewise_function.PiecewiseFunction">PiecewiseFunction</a></li>
<li><a title="Game-Qu.src.game_qu.math.polynomial.Polynomial" href="../../Game-Qu/src/game_qu/math/polynomial.html#Game-Qu.src.game_qu.math.polynomial.Polynomial">Polynomial</a></li>
<li><a title="Game-Qu.src.game_qu.math.quadratic_function.QuadraticFunction" href="../../Game-Qu/src/game_qu/math/quadratic_function.html#Game-Qu.src.game_qu.math.quadratic_function.QuadraticFunction">QuadraticFunction</a></li>
<li><a title="game_qu.math.bounded_function.BoundedFunction" href="bounded_function.html#game_qu.math.bounded_function.BoundedFunction">BoundedFunction</a></li>
<li><a title="game_qu.math.linear_interpolation.LinearInterpolation" href="linear_interpolation.html#game_qu.math.linear_interpolation.LinearInterpolation">LinearInterpolation</a></li>
<li><a title="game_qu.math.piecewise_function.PiecewiseFunction" href="piecewise_function.html#game_qu.math.piecewise_function.PiecewiseFunction">PiecewiseFunction</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/math/linear_interpolation.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ <h3>Ancestors</h3>
</ul>
<h3>Subclasses</h3>
<ul class="hlist">
<li><a title="Game-Qu.src.game_qu.base.paths.Path" href="../../Game-Qu/src/game_qu/base/paths.html#Game-Qu.src.game_qu.base.paths.Path">Path</a></li>
<li><a title="game_qu.base.paths.Path" href="../base/paths.html#game_qu.base.paths.Path">Path</a></li>
</ul>
<h3>Class variables</h3>
Expand Down
Loading

0 comments on commit b6417a9

Please sign in to comment.