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 interaction for computer in room 1 + fix formatting in other files to pass CI checks #63

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

AryanK1511
Copy link
Member

@AryanK1511 AryanK1511 commented Oct 3, 2024

Fixes

In response to @r4pt0s's suggestion, I have used the displayDialogueWithCharacter function to display HTML content to the user whenever the sprite collides with the computer object. This HTML contains a link to the ZTM Careers Page that opens the website in a new tab when clicked.

Here's an image of what this looks like:

Screenshot 2024-10-03 at 3 25 05 AM

Here’s the relevant code for reference:

import { displayDialogueWithoutCharacter } from '../../utils';

const careerPathDialogue = `
    <div>
        <h2>Zero To Mastery Career Paths</h2>
        <p>
            Whether you’re a complete beginner or an experienced professional, figuring out the 
            next step in your career can be overwhelming.
        </p>
        <p>
            Our curated Career Paths provide you with the step-by-step roadmap you need to take you from any level, to getting hired 
            and advancing your career.
        </p>
        <p>
            <a href="https://zerotomastery.io/career-paths/" style="color: #007BFF; text-decoration: none;" target='_blank'>Pick a Career Path here</a> and start your journey.
        </p>
    </div>
`;

export const interactionWithComputer = (player, k, map) => {
    const [computer] = k.query({ include: 'computer' });

    player.onCollide('computer', () => {
        computer.play('on');
        displayDialogueWithoutCharacter(careerPathDialogue);
    });

    player.onCollideEnd('computer', () => {
        computer.play('off');
    });
};

I have attached a video to showcase the functionality and appearance of the dialogue box in action:

Screen.Recording.2024-10-03.at.3.11.33.AM.mov

The code has been formatted using Prettier, and all linting checks have been successfully passed locally.
Please review the changes, and let me know if you would like any modifications or further enhancements.

Copy link

🙏 Thanks for your pull request @AryanK1511, The team will now review and merge this request. In the mean time why not check out some of the other opensource projects available, contributions are greatly appreciated!

Some of the most popular are


PR Statistics

#️⃣ PR Number: Line Additions: 🗑️ Line Deletions:
63 21 0
📑 Files Changed: Repo Stars: 🔱 Total Forks:
1 18 41

@AryanK1511
Copy link
Member Author

AryanK1511 commented Oct 3, 2024

Screenshot 2024-10-03 at 3 28 50 AM

@r4pt0s, The checks fail due to some files related to the jokeTeller sprite. Do you want me to fix them within this PR itself?

Copy link

🙏 Thanks for your pull request @AryanK1511, The team will now review and merge this request. In the mean time why not check out some of the other opensource projects available, contributions are greatly appreciated!

Some of the most popular are


PR Statistics

#️⃣ PR Number: Line Additions: 🗑️ Line Deletions:
63 21 0
📑 Files Changed: Repo Stars: 🔱 Total Forks:
1 18 41

@r4pt0s
Copy link
Collaborator

r4pt0s commented Oct 3, 2024

@AryanK1511 that would be great 🙏🏻

Copy link

🙏 Thanks for your pull request @AryanK1511, The team will now review and merge this request. In the mean time why not check out some of the other opensource projects available, contributions are greatly appreciated!

Some of the most popular are


PR Statistics

#️⃣ PR Number: Line Additions: 🗑️ Line Deletions:
63 25 2
📑 Files Changed: Repo Stars: 🔱 Total Forks:
3 18 41

@AryanK1511 AryanK1511 changed the title Add interaction for computer in room 1 Add interaction for computer in room 1 + fix formatting in other files to pass CI checks Oct 3, 2024
Copy link

🙏 Thanks for your pull request @AryanK1511, The team will now review and merge this request. In the mean time why not check out some of the other opensource projects available, contributions are greatly appreciated!

Some of the most popular are


PR Statistics

#️⃣ PR Number: Line Additions: 🗑️ Line Deletions:
63 25 2
📑 Files Changed: Repo Stars: 🔱 Total Forks:
3 18 41

@AryanK1511
Copy link
Member Author

@r4pt0s, Seems like everything works perfectly now! We are all set to merge 🫡

@r4pt0s r4pt0s added hacktoberfest Hacktoberfest label for 2024 hacktoberfest-accepted labels Oct 3, 2024
@r4pt0s r4pt0s merged commit 10c00de into zero-to-mastery:main Oct 3, 2024
1 check passed
@r4pt0s r4pt0s linked an issue Oct 3, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Hacktoberfest label for 2024 hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Joke Teller NPC Spawn Point Blocks Character Interaction in map_start
2 participants