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

Feat/extend background image #52

Merged
merged 2 commits into from Apr 1, 2024
Merged

Feat/extend background image #52

merged 2 commits into from Apr 1, 2024

Conversation

jasonqiu212
Copy link
Contributor

@jasonqiu212 jasonqiu212 commented Mar 31, 2024

Resolves #37

Copy link
Contributor

@ruihan00 ruihan00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@Junyi00 Junyi00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall implementation looks good and I appreciate the refactoring of the initialisation of GameEngine, GameScene and others.

But I feel that there needs be a larger refactoring around the initialisation of the GameEngine itself. The loading of map entities, creation of player entities and creation of background image should probably not be the responsibility of the view controller... But I understand if this should be in another PR or if u would like to resolve it in this PR would be good too!

@@ -37,17 +40,24 @@ class ViewController: UIViewController {
self.renderer = renderer
}

func setupGameEntities() {
private func createGameEngine() -> GameEngine {
let levelSize = self.storageManager?.getLevelSize(id: 0) ?? CGSize(width: 4_842, height: 1_040)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the id here should be consistent with method setupGameEntities, by passing a variable?

@ruihan00
Copy link
Contributor

ruihan00 commented Apr 1, 2024

I agree that the game engine should handle the setting up of the entities, I will resolve this in the pr for Home Screen as it requires a refactoring of the game engine to set up the game

@ruihan00 ruihan00 merged commit 6199d63 into main Apr 1, 2024
1 check passed
@ruihan00 ruihan00 deleted the extend-background-image branch April 1, 2024 12:07
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.

Populate background image based on level size
3 participants