Skip to content

Commit

Permalink
Add interaction for bedroom_vanity in map_campus_house_1 (#135)
Browse files Browse the repository at this point in the history
Part of #130
  • Loading branch information
r4pt0s authored Oct 11, 2024
2 parents 148b2f7 + f25f347 commit 608b124
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/interactions/map_campus_house_1/bedroomVanity.interaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { displayDialogue } from '../../utils';
import { updateEnergyState } from '../../utils/energyUpdate';

const bedroomVanityDialog = [
`
<div>
<h2>Mirror, mirror, on the wall...</h2>
<p>
Who's the best developer of them all?
</p>
<p>
It's you!
</p>
</div>
`,
];

export const bedroomVanityInteractions = (player, k, map) => {
player.onCollide('bedroom_vanity', () => {
player.isInDialog = true;
displayDialogue({
k,
player,
text: bedroomVanityDialog,
onDisplayEnd: () => {
player.isInDialog = false;
},
});
updateEnergyState(player.state, (player.state.energy + 10));
})
}
2 changes: 2 additions & 0 deletions src/interactions/map_campus_house_1/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { enterMapCityInteraction } from './enterMapCity.interactions';
import { bedInteractions } from './bed.interaction';
import { computerInteractions } from './computer.interaction';
import { bedroomVanityInteractions } from './bedroomVanity.interaction';

const interactions = [
// Add more interactions here
enterMapCityInteraction,
bedInteractions,
computerInteractions,
bedroomVanityInteractions
];

export default interactions;

0 comments on commit 608b124

Please sign in to comment.