-
Notifications
You must be signed in to change notification settings - Fork 23
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
albinahlback
wants to merge
10
commits into
aviks:master
Choose a base branch
from
albinahlback:restructure_GameZero
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Julia uses 4-spaces indexing as standard |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relies on #31 and #33
since it's more julian.
standard.
schduler
toscheduler
in exports.line
from exports.GameZero.jl
to a separate fileGame.jl
,and thus
GameZero.jl
only contains exports, imports and includes.GameZero.jl
to make it clear what it depend upon andexports.
screen.jl
to a separate fileGeom.jl
.screen.jl
toScreen.jl
since it represents a struct.keyboard.jl
toKeyboard.jl
, since it only containedfunctionality for the Keyboard struct.
timer/
for WallTimer-utilities, and removed thesame content in
timer.jl
.timer/
for Scheduled structs and utilities, andremoved the file
timer.jl
.