Skip to content

Commit

Permalink
First iteration of full documenation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed May 12, 2021
1 parent 8c4ce97 commit 3737856
Show file tree
Hide file tree
Showing 14 changed files with 937 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Roll Back Engine

A 2D game engine that's used for a work in progress fighting game. Windows only for now, but may support other platforms in the future. Documentation can be found [here](https://chukobyte.github.io/roll-back-engine/).
A 2D game engine that's used for a work in progress fighting game. Windows only for now, but may support other platforms in the future. Full documentation can be found [here](https://chukobyte.github.io/roll-back-engine/).

### Dependencies & Tools

Expand Down
12 changes: 11 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Welcome to Roll Back Engine Documentation

Roll Back Engine is made for an upcoming online fighting game. Use the left panel to navigate the documentation.
### About

[Roll Back Engine](https://github.com/Chukobyte/roll-back-engine) is a 2D game engine made for an upcoming online fighting game. Use the left panel to navigate the documentation.

### Features

* Entity Component System
* Scene System
* Python scripting
* Networking system for online multiplayer
* Collision system
58 changes: 58 additions & 0 deletions docs/python_api/audio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# roll.audio

## Audio

Interface for music and sound effects. Music will continue to loop until stopped and sound is only played once.

### Variables

None.

---

### Signals

None.

---

### Methods

```python
play_music(music_id: str) -> None:
```

Plays music.


```python
stop_music() -> None:
```

Stops currently playing music.

```python
set_music_volume(volume: int) -> None:
```

Sets volume for music.

```python
play_sound(sound_id: str) -> None:
```

Plays a sound.

```python
set_sounds_volume(volume: int) -> None:
```

Sets volume for sounds.

```python
set_all_volume(volume: int) -> None:
```

Sets volume for all audio.

---
46 changes: 46 additions & 0 deletions docs/python_api/camera.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# roll.camera

## Camera

Engine representation of a camera.


### Variables

None.

---

### Signals

None.

---

### Methods

```python
set_zoom(zoom: rool.math.Vector2) -> None:
```

Sets the camera's zoom.

```python
get_zoom() -> rool.math.Vector2:
```

Gets the camera's zoom.

```python
set_viewport_position(zoom: rool.math.Vector2) -> None:
```

Sets the camera's viewport position.

```python
get_viewport_position() -> rool.math.Vector2:
```

Gets the camera's viewport position.

---
43 changes: 43 additions & 0 deletions docs/python_api/color.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# roll.color

## Color

Engine representation of color.

### Variables

```
r : float
```
Red color.

```
g : float
```
Green color.

```
b : float
```
Blue color.

```
a : float
```
Alpha or transparency of the color.

---

### Methods

**Static functions that return specific values**

```
WHITE() -> Color(1.0, 1.0, 1.0, 1.0):
BLACK() -> Color(0.0, 0.0, 0.0, 1.0):
RED() -> Color(1.0, 0.0, 0.0, 1.0):
GREEN() -> Color(0.0, 1.0, 0.0, 1.0):
BLUE() -> Color(0.0, 0.0, 1.0, 1.0):
```

---
27 changes: 27 additions & 0 deletions docs/python_api/engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# roll.engine

## Engine

Interface for miscellaneous operations for the game engine.

### Variables

None.

---

### Signals

None.

---

### Methods

```python
exit(code=0) -> None:
```

Exits the engine returning the value of `code` as the exit code.

---
13 changes: 12 additions & 1 deletion docs/python_api/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Python API

Python API TBD.
Contains information about the Python scripting API used for Roll Back Engine.

* [Node](node.md)
* [Math](math.md)
* [Color](color.md)
* [Camera](camera.md)
* [Audio](audio.md)
* [Input](input.md)
* [Engine](engine.md)
* [Physics](physics.md)
* [Scene](scene.md)
* [Network](network.md)
153 changes: 153 additions & 0 deletions docs/python_api/input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# roll.input

## Input

Class for handling input.

### Variables

Mouse Action Values

```
Mouse.LEFT_BUTTON = "mb_left" # Left Mouse Button
Mouse.RIGHT_BUTTON = "mb_right" # Right Mouse Button
```

Keyboard Action Values

```
Keyboard.NUM_0 = 0 # Zero
Keyboard.NUM_1 = 1 # One
Keyboard.NUM_2 = 2 # Two
Keyboard.NUM_3 = 3 # Three
Keyboard.NUM_4 = 4 # Four
Keyboard.NUM_5 = 5 # Five
Keyboard.NUM_6 = 6 # Six
Keyboard.NUM_7 = 7 # Seven
Keyboard.NUM_8 = 8 # Eight
Keyboard.NUM_9 = 9 # Nine
Keyboard.A = "a"
Keyboard.B = "b"
Keyboard.C = "c"
Keyboard.D = "d"
Keyboard.E = "e"
Keyboard.F = "f"
Keyboard.G = "g"
Keyboard.H = "h"
Keyboard.I = "i"
Keyboard.J = "j"
Keyboard.K = "k"
Keyboard.L = "l"
Keyboard.M = "m"
Keyboard.N = "n"
Keyboard.O = "o"
Keyboard.P = "p"
Keyboard.Q = "q"
Keyboard.R = "r"
Keyboard.S = "s"
Keyboard.T = "t"
Keyboard.U = "u"
Keyboard.V = "v"
Keyboard.W = "w"
Keyboard.X = "x"
Keyboard.Y = "y"
Keyboard.Z = "z"
Keyboard.UP = "up" # Up Arrow Key
Keyboard.DOWN = "down" # Down Arrow Key
Keyboard.LEFT = "left" # Left Arrow Key
Keyboard.RIGHT = "right" # Right Arrow Key
Keyboard.SPACE = "space" # Space Key
Keyboard.ESC = "esc" # ESC Key
Keyboard.RETURN = "return" # Enter Key
Keyboard.F1 = "f1"
Keyboard.F2 = "f2"
Keyboard.F3 = "f3"
Keyboard.F4 = "f4"
Keyboard.F5 = "f5"
Keyboard.F6 = "f6"
Keyboard.F7 = "f7"
Keyboard.F8 = "f8"
Keyboard.F9 = "f9"
Keyboard.F10 = "f10"
Keyboard.F11 = "f11"
Keyboard.F12 = "f12"
```

Joystick Action Values

```
Joystick.A_BUTTON = "joystick_button_a" # XBOX A
Joystick.B_BUTTON = "joystick_button_b" # XBOX B
Joystick.X_BUTTON = "joystick_button_x" # XBOX X
Joystick.Y_BUTTON = "joystick_button_y" # XBOX Y
Joystick.KEYPAD_UP = "joystick_keypad_up"
Joystick.KEYPAD_DOWN = "joystick_keypad_down"
Joystick.KEYPAD_LEFT = "joystick_keypad_left"
Joystick.KEYPAD_RIGHT = "joystick_keypad_right"
Joystick.LEFT_ANALOG = "joystick_left_analog"
Joystick.LEFT_ANALOG_LEFT = "joystick_left_analog_left"
Joystick.LEFT_ANALOG_RIGHT = "joystick_left_analog_right"
Joystick.LEFT_ANALOG_UP = "joystick_left_analog_up"
Joystick.LEFT_ANALOG_DOWN = "joystick_left_analog_down"
Joystick.RIGHT_ANALOG = "joystick_right_analog"
Joystick.RIGHT_ANALOG_LEFT = "joystick_right_analog_left"
Joystick.RIGHT_ANALOG_RIGHT = "joystick_right_analog_right"
Joystick.RIGHT_ANALOG_UP = "joystick_right_analog_up"
Joystick.RIGHT_ANALOG_DOWN = "joystick_right_analog_down"
Joystick.START_BUTTON = "joystick_start_button"
Joystick.BACK_BUTTON = "joystick_back_button"
Joystick.SHOULDER_LEFT = "joystick_left_shoulder"
Joystick.SHOULDER_RIGHT = "joystick_right_shoulder"
Joystick.TRIGGER_LEFT = "joystick_left_trigger"
Joystick.TRIGGER_RIGHT = "joystick_right_trigger"
```

---

### Signals

None.

---

### Methods

```python
add_action(action_name: str, value: str) -> None:
```

Adds an input action. Multiple input values can be added to the same `action_name`. See `Variables` for possible values.

```python
remove_action(action_name: str) -> None:
```

Completely removes action.


```python
is_action_pressed(action_name: str) -> bool:
```

Returns true if an action input is currently being held down.

```python
is_action_just_pressed(action_name: str) -> bool:
```

Returns true if an action input was just pressed.

```python
is_action_just_released(action_name: str) -> bool:
```

Returns true if an action input was just released.

---
Loading

0 comments on commit 3737856

Please sign in to comment.