-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interaction for bedroom_vanity in map_campus_house_1 (#135)
Part of #130
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/interactions/map_campus_house_1/bedroomVanity.interaction.js
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,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)); | ||
}) | ||
} |
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 |
---|---|---|
@@ -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; |