Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure GameZero #34

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

albinahlback
Copy link
Contributor

Relies on #31 and #33

  1. Removed parentheses around conditionals in while and if statements,
    since it's more julian.
  2. Made spelling more julian.
  3. Changed tab size from 4 to 2, since most packages use this as
    standard.
  4. Respelled schduler to scheduler in exports.
  5. Removed line from exports.
  6. Moved Game-utilities from GameZero.jl to a separate file Game.jl,
    and thus GameZero.jl only contains exports, imports and includes.
  7. Restructured GameZero.jl to make it clear what it depend upon and
    exports.
  8. Moved Geom-utilities from screen.jl to a separate file Geom.jl.
  9. Renamed screen.jl to Screen.jl since it represents a struct.
  10. Made a folder for keyboard-utilities.
  11. Moved every keyboard module to their own module-file.
  12. Renamed keyboard.jl to Keyboard.jl, since it only contained
    functionality for the Keyboard struct.
  13. Made a folder for timer-utilities.
  14. Created a file in timer/ for WallTimer-utilities, and removed the
    same content in timer.jl.
  15. Created a file in timer/ for Scheduled structs and utilities, and
    removed the file timer.jl.

Since polygons are essential in graphics, I added triangle as a struct
and added draw-functionality. Furthermore, I added getPos for this
struct.
By usage of trigonometric function, I was able to reduce the
computational complexity of the algorithm from O(r^2) to O(r).
Since the julian style convention is variables with only lower case
characters, functions with lower case and underscore, and structs with
camel case with upper case for the first letter, I changed files
according to this standard (with some exceptions). Furthermore I changed
some styling, like new lines in order to not go beyond 80 chars on one
line.
1. Removed parentheses around conditionals in while and if statements,
since it's more julian.
2. Made spelling more julian.
3. Changed tab size from 4 to 2, since most packages use this as
standard.
4. Respelled `schduler` to `scheduler` in exports.
5. Removed `line` from exports.
6. Moved Game-utilities from `GameZero.jl` to a separate file `Game.jl`,
and thus `GameZero.jl` only contains exports, imports and includes.
7. Restructured `GameZero.jl` to make it clear what it depend upon and
exports.
8. Moved Geom-utilities from `screen.jl` to a separate file `Geom.jl`.
9. Renamed `screen.jl` to `Screen.jl` since it represents a struct.
10. Made a folder for keyboard-utilities.
11. Moved every keyboard module to their own module-file.
12. Renamed `keyboard.jl` to `Keyboard.jl`, since it only contained
functionality for the Keyboard struct.
13. Made a folder for timer-utilities.
14. Created a file in `timer/` for WallTimer-utilities, and removed the
same content in `timer.jl`.
15. Created a file in `timer/` for Scheduled structs and utilities, and
removed the file `timer.jl`.
Creating modules to be separate files
In order to achieve more structure in the code.
@MarcMush
Copy link

MarcMush commented Apr 9, 2021

Julia uses 4-spaces indexing as standard

@albinahlback
Copy link
Contributor Author

Very true. At the time of the PR I was mostly familiar with packages with 2-spaces indents. I will fix this if this package is going to be maintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants