Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Huvier committed Apr 20, 2021
1 parent e0ce7a8 commit e0a7572
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Informations/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Introduction
PyEngine was created by LavaPower.

PyEngine relies on PyGame to work. It was made to be
used in 2D games of all types: Platformer, Pong, Casse bricks...
used in 2D games of all types: Platformer, Pong, breakout games...

You can find tutorials, examples and documentation of the different classes.

Expand Down
29 changes: 29 additions & 0 deletions engine/components/anim_component.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
AnimComponent
=============

This component add animations to game object.

.. warning:: This component use the TransformComponent and it can't work without it.

Editor
------

In the editor, you can add, remove and manage animations but also change frames per seconds and the current playing animation.

Script
------

Variables
^^^^^^^^^

- game_object: Object which own this component (GameObject)
- engine: Utility class to control the game (Engine)
- fps: Number of frames per seconds (int)
- playing: Name of current animation (string)
- anims: Dictionnary of animations (dict<string, AnimSprite/AnimSpriteSheet>)
- current_sprite: Index of current displayed sprite (int)

Functions
^^^^^^^^^

No public function in this component.
3 changes: 2 additions & 1 deletion engine/components/collision_component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This component add collision and collision callback to game object.
Editor
------

In the editor, you can change if object is solid with a checkbox and specify a callback by giving the name of component and the function will be called.
In the editor, you can change the size of collision, if the object is solid with a checkbox and specify a callback by giving the name of component and the function will be called.

Script
------
Expand All @@ -20,6 +20,7 @@ Variables
- engine: Utility class to control the game (Engine)
- solid: True if object is solid (boolean)
- callback: Component and its function which will be call on collide (string)
- size: Size of the collider (Vec2)

.. note:: callback use a specific format : "NameComponent - NameFunction".
For example: "myScript - collide" is a valid callback.
Expand Down
2 changes: 1 addition & 1 deletion engine/components/control_component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Editor

In the editor, you can change keys, control type and speed.

.. note:: Keys with pygame's names and space to separate two keys.
.. note:: Keys with pygame's names and space to separate keys.

.. note:: List of Control type :
- FOURDIRECTION : Object can move in four directions (Up, Down, Left, Right)
Expand Down
27 changes: 27 additions & 0 deletions engine/components/music_component.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
MusicComponent
==============

This component add music to game object.

Editor
------

In the editor, you can change music by selection or drag and drop, volume, if is currently playing and if it loops.

Script
------

Variables
^^^^^^^^^

- game_object: Object which own this component (GameObject)
- engine: Utility class to control the game (Engine)
- music: Current music (string)
- volume: Current volume from 0 to 100 (integer)
- play: True if is current playing (boolean)
- loop: True if it loops (boolean)

Functions
^^^^^^^^^

No public function in this component.
25 changes: 25 additions & 0 deletions engine/components/sound_component.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SoundComponent
==============

This component add sounds to game object.

Editor
------

In the editor, you can change sound by selecting or drag and drop and volume.

Script
------

Variables
^^^^^^^^^

- game_object: Object which own this component (GameObject)
- engine: Utility class to control the game (Engine)
- sound: Current sound (string)
- volume: Current volume from 0 to 100 (integer)

Functions
^^^^^^^^^

- play(): Play the current sound
2 changes: 1 addition & 1 deletion engine/components/sprite_component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This component add sprite to game object.
Editor
------

In the editor, you can change sprite by selecting json file.
In the editor, you can change sprite by selecting json file or drag and drop.

Script
------
Expand Down
2 changes: 1 addition & 1 deletion engine/components/spritesheet_component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This component add spritesheet to game object.
Editor
------

In the editor, you can change spritesheet by selecting json file but also the numbers of sprite and the current index of sprite.
In the editor, you can change spritesheet by selecting json file or drag and drop but also the numbers of sprite and the current index of sprite.

Script
------
Expand Down
8 changes: 8 additions & 0 deletions engine/editor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ A texture is a .PNG or .JPG file which can be used for a sprite.
On creation, PyEngine4 ask a name and a path to the file.
If you double click on it, you will be able to change the path.

Sounds
^^^^^^

A sounds is a .WAV, .OGG or .MP3 which can be used in AudioComponent or MusicComponent.

On create, PyEngine4 ask a name and a path to the file.
If you double click on it, you will be able to change the path.

Scenes
^^^^^^

Expand Down
3 changes: 2 additions & 1 deletion engine/game_object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Variables
- childs: List of childs game objects of current object (list of GameObject)
- components: List of components of current object (list of Components)
- id\_: Id of object (integer)
- tag : Tag of object (string)

.. warning:: Most of these variables mustn't be manipulated. Only id\_ and parents are safe on reading.
.. warning:: Most of these variables mustn't be manipulated. Only id\_ and parents are safe on reading and tag is safe reading and writing.

Functions
---------
Expand Down
18 changes: 18 additions & 0 deletions engine/settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Settings
========

There are two types of settings : Project and Engine Settings.

Project
-------

- engine_version: Version of PyEngine4
- width: Width of window
- height: Height of window
- mainScene: Name of the main scene (will be the first played scene
- numberMixerChannels: Number of audio channel for SoundComponent

Engine
------

- editor: Path of script editor.
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Summary:
:caption: Engine

engine/project_window.rst
engine/settings.rst
engine/editor.rst
engine/game.rst
engine/scene.rst
Expand Down

0 comments on commit e0a7572

Please sign in to comment.