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
Feat/rendering multiplayer #33
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
143a768
refactor: Refactor PlayerView
Junyi00 3c767fe
Merge remote-tracking branch 'origin' into feat/rendering-multiplayer
Junyi00 5e98873
chore: Integrate use of camera with rendering
Junyi00 a590b02
fix: Fix syntax issues
Junyi00 4c8c697
Merge remote-tracking branch 'origin' into feat/rendering-multiplayer
Junyi00 f94f494
chore: Connect controls to player entities
Junyi00 b769f06
feat: Rendering for two players
Junyi00 ba97169
fix: Fix syntax issues
Junyi00 e3f6554
fix: Fix views from updating ahead of another
Junyi00 8384ec1
chore: Reorganise rendering files
Junyi00 bc36904
refactor: Refactor overlay update logic
Junyi00 71990c1
fix: Fix syntax errors
Junyi00 cd747c3
chore: Add docs for UIView extension
Junyi00 5a92c5f
chore: Remove resolved todo
Junyi00 5c6102f
Merge remote-tracking branch 'origin' into feat/rendering-multiplayer
Junyi00 208ff9e
fix: Fix syntax issues
Junyi00 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import UIKit | ||
|
||
/** | ||
* The extension introduces an initisalisation method to add subviews | ||
* to a frame that is rotated, however the view is not rotated. | ||
*/ | ||
extension UIView { | ||
convenience init(frame: CGRect, rotatedBy rotation: CGFloat) { | ||
self.init(frame: frame.applying(CGAffineTransform(rotationAngle: rotation))) | ||
self.transform = CGAffineTransform(rotationAngle: rotation) | ||
self.center = CGPoint(x: frame.midX, y: frame.midY) | ||
} | ||
} |
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the camera only follow the x position of the player?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By doing so, we need to initialize y position of camera to half of the height of the scene.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed it was previously only tracking the x position, but the player may jump up to higher platforms and exit the height of what the view can see...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that's true. My rationale for fixing the camera's y position was because if the camera track's the player's y position as well, then we may run out of the background image when going up. I guess it can be said that levels should not be limited in height (maybe can have a level that's focused in the sky or something), but with the lack of assets, would it be better to just cap how high the player can go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we resolve this after we have a complete level ready? We can test then what feels most normal/natural. We can create an issue in the meantime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay that sounds good!