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

Add every igloo #23

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

sky-is-winning
Copy link
Contributor

@sky-is-winning sky-is-winning commented Sep 24, 2024

Assets:
https://drive.google.com/file/d/1BjpMunXmFGUubPLuDxZL8Y0pQpk9m1rj/view?usp=sharing

Raw:
https://drive.google.com/file/d/1Bl3VFwAPguojeaiQGuW-Hxds3wo1LMUd/view?usp=sharing

Explanation of all changes

src/data/igloo.js

  • Added all igloo scene data.

src/scenes/components/Button.js

  • Change setFrame functions to always keep the original size and origin of the base image, so that igloo doors which have pivot points set in TexturePacker don't randomly move when hovered over.

src/scenes/igloos/IglooScene.js

  • Checks if an igloo has a floor before setting its depth. This prevents the game crashing on an igloo with no floor.

  • Checks for a -igloo-physics.json file first before looking for a -physics.json file. This is so IglooScenes with the same name as RoomScenes (like cave) don't accidentally use each other's physics data. Same naming convention is used with all animation, pack and multiatlas files, for the same reason.


src/scenes/interface/game/iglooedit/gridview/GridView.js

  • Filters igloo inventory by which igloos are available in crumbs, rather than just != 0.

Also:

  • Updated Basic and all igloos that use the same physics to have correct triggers. (They were previously the wrong size).
  • Updated the existing 12 igloos to have doors which open when hovered and move to the trigger when clicked.
  • Updated the existing 12 igloos to open the map when standing on the trigger, as they should.

@sky-is-winning sky-is-winning changed the title Add every igloo. Add every igloo Sep 24, 2024
@ChrisCPI
Copy link

ChrisCPI commented Oct 7, 2024

what happens when a room and an igloo share the same scene key? for example the Cave igloo and the actual Cave room having the same key "Cave"

@ChrisCPI
Copy link

ChrisCPI commented Oct 8, 2024

if my above comment is actually an issue, then i have a proposed solution
what if all igloo scene keys were appended with something like "Igloo"?

so IglooScene.js would have the following:

    constructor(key) {
        super(`${key}Igloo`)

And then createIgloo in RoomFactory.js would be something like this:

    createIgloo(args) {
        let config = this.igloos[args.type]
        
        const key = `${config.key}Igloo`

        if (config.key in this.scene.manager.keys) {
            this.scene.start(key, { args: args })

            return this.scene.get(key)

        } else {
            return this.scene.add(key, config.scene, true, { args: args })
        }
    }

@sky-is-winning
Copy link
Contributor Author

@ChrisCPI

what happens when a room and an igloo share the same scene key? for example the Cave igloo and the actual Cave room having the same key "Cave"

You're right, I didn't test that in vanilla Yukon. It does indeed load the wrong scene in this case. Good fix proposal, will implement something similar.

Fix the wrong scene appearing when an igloo and a loaded room have the same scene name by differentiating all igloo scene keys with a `-igloo` suffix
@sky-is-winning
Copy link
Contributor Author

Fixed.

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