~ TO PLAY/TEST THE MULTIPLAYER, BUILD THE PROJECT INTO AN EXECUTABLE ON YOUR OWN COMPUTER UNDER FILE > BUILD SETTINGS ~
This is the actual game of Marballs we will be creating through the Unity game engine. This readme will be updated as relevant information comes up.
- Pull before modifying anything! If someone else modifies something before you're done, pull it in anyway!
- After you're done making changes, push to your branch and send a pull request to Chris's branch.
- Try to avoid modifying the same files/lines that others are working on at the same time.
- If there's a merge conflict and you're using "Git GUI", do the following:
- Click on a conflicting file.
- Right click on the area that shows the file's content.
- Choose which version of the file to keep: local is your version, remote belongs to the other branch.
- Naming Conventions:
- Anything named should have a name reflecting its purpose. (ex. a calculating function can be named Calculate, but probably not Donut)
- Constant names should be in ALL CAPS. (ex: const float PI = 3.14)
- Variable names should use camelBack casing. (ex: int num, float preciseNum)
- Function, file, object, class, and enum declaration names should use CamelCaps. (ex. void FixedUpdate())
- Comments:
-
Comments should typically use // and be placed after or above the line they are explaining.
-
All functions and important variables should have an accompanying comment explaining their purpose.
- Function comments should be of the format: // FunctionName - Explanation
-
All scripts should have a comment section at the beginning of the file with the following information:
``` /// <summary> [this and the closing tag are generated by Unity after typing ///] /// Filename.type /// Authors: [if you contribute or modify the code, add your name] /// Date Created: MMM. DD, YYYY /// Last Revision: MMM. DD, YYYY [update this if you change the code] /// /// Explanation of script's general purpose. /// /// NOTES: [list of things to be aware of when using script] /// /// TO-DO: [list of things that need doing] /// /// </summary> ```
- General:
- Aim for modularity and reusability!
- Avoid redundant code where possible.
- You can more easily set up levels now by going to the Marballs menu in the editor! Just click "Create Level"!
- Coroutine Usage:
- WaitForSeconds values that are too small (~3 decimal places) will default to the length of a frame! Consider using a different WaitFor___ function.
- Coroutines may seem like they run in parallel, but they occupy the same thread space.
- Events:
- To subscribe to a script's event, add the desired function to the event in OnEnable.
- ALWAYS unsubscribe from events after adding them! Do so in OnDisable. This is to prevent memory leaks.