Skip to content

Commit aa72f57

Browse files
Add info files and update formatting to Google standards
1 parent 8f69b01 commit aa72f57

File tree

27 files changed

+1478
-1381
lines changed

27 files changed

+1478
-1381
lines changed

.editorconfig

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,46 @@
11
# https://editorconfig.org
2+
# http://editorconfig.org
23
root = true
34

45
[*]
5-
indent_style = space
6-
end_of_line = lf
76
charset = utf-8
8-
trim_trailing_whitespace = true
7+
end_of_line = lf
98
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.java]
12+
# 2-space indentation (Google Style Guide Section 4.2)
13+
indent_style = space
14+
15+
# Limit line length to 100 characters (Section 4.4)
16+
max_line_length = 100
17+
18+
# Standard Java formatting rules
19+
ij_java_use_single_class_imports = true
20+
ij_java_insert_inner_class_imports = false
21+
ij_java_class_count_to_use_import_on_demand = 999
22+
ij_java_names_count_to_use_import_on_demand = 999
23+
ij_java_packages_to_use_import_on_demand = unset
24+
ij_java_blank_lines_before_class_end = 1
25+
ij_java_blank_lines_after_class_header = 1
26+
27+
# Block formatting (Section 4.1.2)
28+
ij_java_class_brace_style = end_of_line
29+
ij_java_method_brace_style = end_of_line
30+
31+
# Space before opening brace (Section 4.6.2)
32+
ij_java_space_before_class_left_brace = true
33+
ij_java_space_before_method_left_brace = true
34+
ij_java_space_before_if_left_brace = true
35+
ij_java_space_before_while_left_brace = true
36+
ij_java_space_before_for_left_brace = true
37+
ij_java_space_before_try_left_brace = true
38+
ij_java_space_before_catch_left_brace = true
39+
ij_java_space_before_switch_left_brace = true
40+
ij_java_space_before_synchronized_left_brace = true
1041

1142
[*.{java,scala,groovy,kt,kts}]
12-
indent_size = 4
43+
indent_size = 2
1344

1445
[*.gradle]
1546
indent_size = 2

COMPILING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# How to Compile FNF:JE
2+
3+
There are two main ways you can download and compile the game's code: with GitHub Desktop or the terminal.
4+
5+
In this guide, we'll use the GitHub Desktop method, since it the most user-friendly experience, which provides you a nice UI and does all the hard stuff for you!
6+
7+
# Prerequisites (for all methods)
8+
- A [GitHub](https://github.com) account to download the game's GitHub repository.
9+
- A [Java Development Kit (JDK)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) to compile the game's code.
10+
- An integrated development environment.
11+
- We recommend either one of the options listed below:
12+
- [Intellij IDEA](https://www.jetbrains.com/idea/download/) (RECOMMENDED)
13+
- [Eclipse](https://www.eclipse.org/downloads/)
14+
- [VS Code](https://code.visualstudio.com/)
15+
- Some basic knowledge of programming (especially Gradle) and how to navigate an IDE.
16+
17+
# Step-by-Step Guide
18+
19+
1. Visit the official [GitHub Desktop website](https://desktop.github.com/download/) and download the app.
20+
21+
> [!TIP]
22+
> If you're on Linux, don't worry! You can install a community made version by running the following commands in the terminal:
23+
> ```shell
24+
> wget -qO - https://mirror.mwt.me/shiftkey-desktop/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/mwt-desktop.gpg > /dev/null
25+
> sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/mwt-desktop.gpg] https://mirror.mwt.me/shiftkey-desktop/deb/ any main" > /etc/apt/sources.list.d/mwt-desktop.list'
26+
> ```
27+
> When it's done downloading, you can install the application by running the following command:
28+
> ```shell
29+
> sudo apt update && sudo apt install github-desktop
30+
> ```
31+
32+
2. When GitHub Desktop is done installing, sign in with your GitHub account when prompted to do so.
33+
34+
3. Go back to your browser and (on the official home page for FNF:JE's repository), click the green `<> Code` button and select `Open with GitHub Desktop`. You should see a prompt asking if you want to clone the game's code.
35+
36+
4. Click the blue `Clone` button and wait for the game's code to download.
37+
38+
> [!TIP]
39+
> We recommend putting the game's code in a place where you'll easily remember where it's at, such as your `Documents\GitHub` folder if you're on Windows!
40+
41+
5. Launch your IDE and open the game's folder when prompted to do so.
42+
43+
> [!IMPORTANT]
44+
> When you open the game's folder, your IDE will most likely start running Gradle tasks. Don't worry, this is normal and expected!
45+
46+
6. When the tasks are finished, you can now run the game's code! You can do so by running the applicable task depending on the platform.
47+
- For example, you can run the desktop version by executing the task `lwjgl3:run`.

CONTRIBUTING.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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.

README.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
1-
# Funkin-Java
1+
# Friday Night Funkin': Java Edition
22

3-
A [libGDX](https://libgdx.com/) project generated with [gdx-liftoff](https://github.com/libgdx/gdx-liftoff).
3+
Welcome to the official GitHub repository for the Java edition of Friday Night Funkin'!
44

5-
This project was generated with a template including simple application launchers and an `ApplicationAdapter` extension that draws libGDX logo.
6-
7-
## Platforms
8-
9-
- `core`: Main module with the application logic shared by all platforms.
10-
- `lwjgl3`: Primary desktop platform using LWJGL3; was called 'desktop' in older docs.
11-
- `android`: Android mobile platform. Needs Android SDK.
12-
13-
## Gradle
14-
15-
This project uses [Gradle](https://gradle.org/) to manage dependencies.
16-
The Gradle wrapper was included, so you can run Gradle tasks using `gradlew.bat` or `./gradlew` commands.
17-
Useful Gradle tasks and flags:
18-
19-
- `--continue`: when using this flag, errors will not stop the tasks from running.
20-
- `--daemon`: thanks to this flag, Gradle daemon will be used to run chosen tasks.
21-
- `--offline`: when using this flag, cached dependency archives will be used.
22-
- `--refresh-dependencies`: this flag forces validation of all dependencies. Useful for snapshot versions.
23-
- `android:lint`: performs Android project validation.
24-
- `build`: builds sources and archives of every project.
25-
- `cleanEclipse`: removes Eclipse project data.
26-
- `cleanIdea`: removes IntelliJ project data.
27-
- `clean`: removes `build` folders, which store compiled classes and built archives.
28-
- `eclipse`: generates Eclipse project data.
29-
- `idea`: generates IntelliJ project data.
30-
- `lwjgl3:jar`: builds application's runnable jar, which can be found at `lwjgl3/build/libs`.
31-
- `lwjgl3:run`: starts the application.
32-
- `test`: runs unit tests (if any).
33-
34-
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.
35-
For example, `core:clean` removes `build` folder only from the `core` project.
5+
### Please note that this unofficial version of the game is NOT completed! This has a long way to go, but with YOUR help, we can make this project come alive! <3
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package me.stringfromjava.funkin.android;
22

33
import android.os.Bundle;
4-
54
import com.badlogic.gdx.backends.android.AndroidApplication;
65
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
76
import me.stringfromjava.funkin.FunkinGame;
87

98
/** Launches the Android application. */
109
public class AndroidLauncher extends AndroidApplication {
11-
@Override
12-
protected void onCreate(Bundle savedInstanceState) {
13-
super.onCreate(savedInstanceState);
14-
AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
15-
configuration.useImmersiveMode = true; // Recommended, but not required.
16-
initialize(new FunkinGame(), configuration);
17-
}
10+
11+
@Override
12+
protected void onCreate(Bundle savedInstanceState) {
13+
super.onCreate(savedInstanceState);
14+
AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
15+
configuration.useImmersiveMode = true; // Recommended, but not required.
16+
initialize(new FunkinGame(), configuration);
17+
}
1818
}

0 commit comments

Comments
 (0)