|
| 1 | +# How to Contribute |
| 2 | + |
| 3 | +Around here, things are somewhat simple. All we ask is that you follow the basic rules and have common sense. |
| 4 | + |
| 5 | +## Basic Info |
| 6 | + |
| 7 | +- When you create a pull request to be merged into `develop`, please note that the rules will be *heavily* enforced. This is NOT because we want to be mean, but rather it's to make sure that FNF:JE has a good codebase. We don't want any contributors to deal with poorly put together code! |
| 8 | +- If you're looking for how to compile the game, please take a look at [COMPILING.md](COMPILING.md)! |
| 9 | + |
| 10 | +## Issues |
| 11 | + |
| 12 | +If you wish to fix a bug, make an enhancement, or even wish to |
| 13 | +simply make a recommendation, then no worries! You can make an [issue](https://github.com/stringfromjava/Starcore/issues) |
| 14 | +or create a sub-issue and help someone with something that needs to be worked on! |
| 15 | + |
| 16 | +> [!IMPORTANT] |
| 17 | +> Make sure to set the base branch to `develop` on your pull request, or otherwise ***it will NOT be merged and accepted!!*** |
| 18 | +
|
| 19 | +## Comments & Formatting |
| 20 | + |
| 21 | +Comments are very valuable because they allow you and other |
| 22 | +programmers to easily understand what is happening in your code. |
| 23 | + |
| 24 | +However, sometimes they can be a hindrance as well. |
| 25 | + |
| 26 | +If your comments have typos, aren't clear or concise, or just |
| 27 | +hard to understand in general, then they won't be any |
| 28 | +use. Even too many comments are unnecessary, since your code should be |
| 29 | +self documented and easily readable. |
| 30 | + |
| 31 | +<u>***Formatting MUST match the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html).***</u> |
| 32 | + |
| 33 | +### Example of GOOD Comments (With Good Formatting) |
| 34 | + |
| 35 | +```java |
| 36 | +/** |
| 37 | + * Plays a sound. (Duh.) |
| 38 | + * |
| 39 | + * @param path The path to play the sound from. |
| 40 | + * @return The sound instance itself, as a {@link FunkinSound}. |
| 41 | + */ |
| 42 | +public static FunkinSound playSound(String path) { |
| 43 | + FunkinSound sound = new FunkinSound(path); |
| 44 | + if (sound.ID != -1) { // libGDX will return -1 if the sound fails to play. |
| 45 | + soundPool.put(sound.ID, sound); |
| 46 | + } |
| 47 | + sound.play(); |
| 48 | + return sound; |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +### Example of BAD Comments (With Bad Formatting) |
| 53 | + |
| 54 | +```java |
| 55 | +/** |
| 56 | + * ooohhhhhef idkk plays a sound igg?????? |
| 57 | + * |
| 58 | + * @prm daPatyhh its da path to play der sound (iykyk :fire:) |
| 59 | + * @return tf you think vro :broken_heart: |
| 60 | + */ |
| 61 | +public static |
| 62 | +FunkinSound playSound (String |
| 63 | + path) |
| 64 | +{ |
| 65 | + FunkinSound sound = new FunkinSound(path); |
| 66 | + if |
| 67 | + (sound.ID != -1){ // i have lito have no idea what this does :wilted_flower: |
| 68 | + soundPool.put(sound.ID, sound); |
| 69 | + } |
| 70 | +sound.play(); |
| 71 | + return sound; |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +# libGDX |
| 76 | + |
| 77 | +This is a [libGDX](https://libgdx.com/) project generated with [gdx-liftoff](https://github.com/libgdx/gdx-liftoff). |
| 78 | + |
| 79 | +## Platforms |
| 80 | + |
| 81 | +FNF:JE is designed to run on multiple different platforms. Below are the different modules that hold the code for each one. |
| 82 | + |
| 83 | +- `core`: Main module with the game's logic shared by all platforms. <u>This is where you want to write your source code!</u> |
| 84 | +- `lwjgl3`: Primary desktop platform using [LWJGL3](https://www.lwjgl.org/). This is what launches the desktop versions of the game! |
| 85 | +- `android`: Android mobile platform. <u>This requires the Android SDK, which can be downloaded and configured simply by running the universal [setup file](setup/android_setup.sh)!</u> |
| 86 | + |
| 87 | +## Gradle |
| 88 | + |
| 89 | +This project uses [Gradle](https://gradle.org/) to manage dependencies. |
| 90 | +The Gradle wrapper was included, so you can run Gradle tasks using `gradlew.bat` or `./gradlew` commands. |
| 91 | + |
| 92 | +# Gradle Flags and Tasks |
| 93 | + |
| 94 | +- `--continue`: when using this flag, errors will not stop the tasks from running. |
| 95 | +- `--daemon`: thanks to this flag, Gradle daemon will be used to run chosen tasks. |
| 96 | +- `--offline`: when using this flag, cached dependency archives will be used. |
| 97 | +- `--refresh-dependencies`: this flag forces validation of all dependencies. Useful for snapshot versions. |
| 98 | +- `android:lint`: performs Android project validation. |
| 99 | +- `build`: builds sources and archives of every project. |
| 100 | +- `cleanEclipse`: removes Eclipse project data. |
| 101 | +- `cleanIdea`: removes IntelliJ project data. |
| 102 | +- `clean`: removes `build` folders, which store compiled classes and built archives. |
| 103 | +- `eclipse`: generates Eclipse project data. |
| 104 | +- `idea`: generates IntelliJ project data. |
| 105 | +- `lwjgl3:jar`: builds the game's runnable jar, which can be found at `lwjgl3/build/libs`. |
| 106 | +- `lwjgl3:run`: starts the desktop version of the game. |
| 107 | +- `test`: runs unit tests (if any). |
| 108 | + |
| 109 | +Note that most tasks that are not specific to a single project can be run with `name:` prefix, where the `name` should be replaced with the ID of a specific project. |
| 110 | +For example, `core:clean` removes `build` folder only from the `core` project. |
0 commit comments