|
| 1 | +# How to Contribute |
| 2 | + |
| 3 | +Since Starcore isn't that big of a game yet, things are somewhat simple. |
| 4 | +All we ask is that you follow the basic rules and have common sense. |
| 5 | + |
| 6 | +When you write code, heres some simple things we ask of you: |
| 7 | + |
| 8 | +## Issues |
| 9 | + |
| 10 | +If you wish to fix a bug, make an enhancement, or even wish to |
| 11 | +simply make a recommendation, then no worries! You can make an [issue](https://github.com/korithekoder/Starcore/issues) |
| 12 | +or create a sub-issue and help someone with an issue that needs to be worked on! |
| 13 | + |
| 14 | +## Comments & Formatting |
| 15 | + |
| 16 | +Comments are very valuable because they allow you and other |
| 17 | +programmers to easily understand what is happening in your code. |
| 18 | + |
| 19 | +However, sometimes they can be a hindrance as well. |
| 20 | + |
| 21 | +If your comments have typos, aren't clear or concise, or just |
| 22 | +hard to understand in general, then they won't be any |
| 23 | +use. Even too many comments can make it difficult to understand your code. |
| 24 | + |
| 25 | +### Example of GOOD Comments (With Good Formatting) |
| 26 | + |
| 27 | +```haxe |
| 28 | +/** |
| 29 | + * Get's the last key that was pressed on the current frame. |
| 30 | + * |
| 31 | + * @return The last key that was pressed. If no keys were pressed, then |
| 32 | + * `FlxKey.NONE` is returned instead. |
| 33 | + */ |
| 34 | +public static function getLastKeyPressed():FlxKey |
| 35 | +{ |
| 36 | + for (key in 8...303) // Loop through all keys in FlxKey |
| 37 | + { |
| 38 | + try |
| 39 | + { |
| 40 | + if (FlxG.keys.anyJustPressed([key])) |
| 41 | + { |
| 42 | + return key; |
| 43 | + } |
| 44 | + } |
| 45 | + catch (e:Exception) |
| 46 | + { |
| 47 | + // Skip and move on if it is not a valid key |
| 48 | + } |
| 49 | + } |
| 50 | + return FlxKey.NONE; |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +### Example of BAD Comments (With Bad Formatting) |
| 55 | + |
| 56 | +```haxe |
| 57 | +
|
| 58 | +/** |
| 59 | + * gets the last key or whatever that was pressed |
| 60 | + * return the last thing pressed lolz |
| 61 | + */ |
| 62 | +public |
| 63 | +static |
| 64 | +function getLastpressed():FlxKey |
| 65 | +{ |
| 66 | + // loop thouhg all keys (8-303) |
| 67 | + for (key in 8...303) // loop through all keys |
| 68 | + { |
| 69 | + // try to check if its pressed :p |
| 70 | + try{ |
| 71 | + // check if its pressed |
| 72 | + if (FlxG.keys.anyJustPressed([key])) |
| 73 | + { |
| 74 | + // return the pressed key |
| 75 | + return key; |
| 76 | + } |
| 77 | + } |
| 78 | + // catch the exception |
| 79 | + catch (e:Exception) { |
| 80 | + // just skip with non valid key xd |
| 81 | + } |
| 82 | + } |
| 83 | + // return nnoe if no kyes are pressed |
| 84 | + return FlxKey.NONE; |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +> [!TIP] |
| 89 | +> You can format a file on VS Code with `SHIFT` + `ALT` + `F` to match the code style standards, although just know that it won't fix typos or correct your grammar, thats all on you! |
| 90 | +
|
| 91 | +## Things You CANNOT Do |
| 92 | + |
| 93 | +Excluding *collaborators*, there are some files that contributors simply cannot change or delete. |
| 94 | + |
| 95 | +1. You are not allowed to change these files: |
| 96 | + - Any files in the [setup folder](setup/). |
| 97 | + - Any files in the [unused folder](unused/), that's for the collaborators! |
| 98 | + - `.gitattributes` |
| 99 | + - `.gitignore` |
| 100 | + - `.prettier.js` |
| 101 | + - `checkstyle.json` |
| 102 | + - `COMPILING.md` |
| 103 | + - `CONTRIBUTING.md` |
| 104 | + - `hxformat.json` |
| 105 | + - `LICENSE.md` |
| 106 | + - `project.hxp` |
| 107 | + - `README.md` |
0 commit comments