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

fix: change player state to proxy object #183

Merged
merged 6 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,28 @@ export const jessie = {
frames: [180, 184, 182, 188, 181, 186],
};
export const conversationJessie = [
'Hey there! Welcome to the arcade! Ready to have some fun?',
"Hi! I'm Jessie. Need any tips on the best games here?",
"Hello! Have you tried the new racing game? It's awesome!",
"Welcome! I'm Jessie. Let's see if you can beat my high score!",
'Hey! Looking for a challenge? I can show you the toughest games.',
"Hi there! Don't forget to check out the prize counter after playing!",
"Hello! Need any help finding a game? I'm your go-to guide!",
"Hey! Ready to play? I've got some great game recommendations for you.",
[
'Hey there! Welcome to the arcade! Ready to have some fun?',
'You can even earn some coins while having fun.',
],
[
"Hi! I'm Jessie. Need any tips on the best games here?",
'Few games even gift you some coins when you reach difficult milestone in that game.',
'Like Chrome Dino Game and Flappy Bird Game.',
],
["Hello! Have you tried the new racing game? It's awesome!"],
["Welcome! I'm Jessie. Let's see if you can beat my high score!"],
['Hey! Looking for a challenge? I can show you the toughest games.'],
["Hi there! Don't forget to check out the prize counter after playing!"],
[
"Hello! Need any help finding a game? I'm your go-to guide!",
'I can even tell you games that can give you some coins.',
'Hint: Something to do with numbers. Can you guess it?',
"Ok. If you didn't get the previous one, I will give you another.",
'Hint: A crawling machine that picks stuff up.',
],
[
"Hey! Ready to play? I've got some great game recommendations for you.",
'Checkout the Chrome Dino Game for some coins.',
],
];
4 changes: 3 additions & 1 deletion src/interactions/map_arcade/jessie.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export const interactionWithJessie = (player, k, map) => {
k,
player,
characterName: jessie.name,
text: conversationJessie,
text: conversationJessie[
Math.floor(Math.random() * conversationJessie.length)
],
onDisplayEnd: () => {
player.state.hasTalkedToJessie = true;
},
Expand Down
2 changes: 1 addition & 1 deletion src/interactions/map_start/enterMapCityLeft.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const enterMapCityLeftInteraction = (player, k, map) => {
player,
text: [
'You should talk to Bruno first.',
'He is the guy with the beautiful suite to your left side.',
'He is the guy with the beautiful suit at the other entrance.',
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const enterMapCityRightInteraction = (player, k, map) => {
player,
text: [
'You should talk to Bruno first.',
'He is the guy with the beautiful suite to your left side.',
'He is the guy with the beautiful suit to your left side.',
],
});

Expand Down
2 changes: 1 addition & 1 deletion src/scenes/gameMachine/lose.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const loseScreen = ({
[255, 0, 0]
);

exitButton.onClick(exitGame);
exitButton.onMouseRelease(exitGame);
restartButton.onClick(restartGame);

k.onKeyPress('escape', exitGame);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/resetPausingVariables.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const resetPausingVariables = (player) => {
player.state = { ...player.state, isInDialog: false };
player.state.isInDialog = false;
};