diff --git a/assets/UI/computer/computerElements.json b/assets/UI/computer/computerElements.json index 9251eb1..c130c1b 100644 --- a/assets/UI/computer/computerElements.json +++ b/assets/UI/computer/computerElements.json @@ -120,7 +120,7 @@ "y": 0.5 } }, - "profilePhotoM": { + "profilePhotoF": { "frame": { "x": 600, "y": 500, @@ -144,7 +144,7 @@ "y": 0.5 } }, - "profilePhotoF": { + "profilePhotoM": { "frame": { "x": 800, "y": 500, diff --git a/assets/backgrounds/nightmares/gum.png b/assets/backgrounds/nightmares/gum.png deleted file mode 100644 index 6411844..0000000 Binary files a/assets/backgrounds/nightmares/gum.png and /dev/null differ diff --git a/assets/backgrounds/nightmares/gumChair.png b/assets/backgrounds/nightmares/gumChair.png deleted file mode 100644 index 6379146..0000000 Binary files a/assets/backgrounds/nightmares/gumChair.png and /dev/null differ diff --git a/assets/backgrounds/nightmares/nightmaresBg.png b/assets/backgrounds/nightmares/nightmaresBg.png deleted file mode 100644 index 57c2c87..0000000 Binary files a/assets/backgrounds/nightmares/nightmaresBg.png and /dev/null differ diff --git a/assets/backgrounds/nightmares/nightmaresChair.png b/assets/backgrounds/nightmares/nightmaresChair.png deleted file mode 100644 index 5cee32c..0000000 Binary files a/assets/backgrounds/nightmares/nightmaresChair.png and /dev/null differ diff --git a/assets/backgrounds/nightmares/nightmaresElements.json b/assets/backgrounds/nightmares/nightmaresElements.json new file mode 100644 index 0000000..3e75314 --- /dev/null +++ b/assets/backgrounds/nightmares/nightmaresElements.json @@ -0,0 +1,87 @@ +{ + "frames": { + "nightmaresChair.png": { + "frame": { + "x": 0, + "y": 0, + "w": 182, + "h": 302 + }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { + "x": 9, + "y": 9, + "w": 182, + "h": 302 + }, + "sourceSize": { + "w": 200, + "h": 320 + }, + "pivot": { + "x": 0.5, + "y": 0.5 + } + }, + "gum.png": { + "frame": { + "x": 0, + "y": 302, + "w": 85, + "h": 85 + }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { + "x": 3, + "y": 2, + "w": 85, + "h": 85 + }, + "sourceSize": { + "w": 90, + "h": 90 + }, + "pivot": { + "x": 0.5, + "y": 0.5 + } + }, + "gumChair.png": { + "frame": { + "x": 0, + "y": 387, + "w": 165, + "h": 66 + }, + "rotated": false, + "trimmed": true, + "spriteSourceSize": { + "x": 3, + "y": 7, + "w": 165, + "h": 66 + }, + "sourceSize": { + "w": 170, + "h": 80 + }, + "pivot": { + "x": 0.5, + "y": 0.5 + } + } + }, + "meta": { + "app": "http://free-tex-packer.com", + "version": "0.6.7", + "image": "nightmaresElements.png", + "format": "RGBA8888", + "size": { + "w": 182, + "h": 453 + }, + "scale": 1 + } +} \ No newline at end of file diff --git a/assets/backgrounds/nightmares/nightmaresElements.png b/assets/backgrounds/nightmares/nightmaresElements.png new file mode 100644 index 0000000..c15425e Binary files /dev/null and b/assets/backgrounds/nightmares/nightmaresElements.png differ diff --git a/localization/day1/nightmareDay1.json b/localization/day1/nightmareDay1.json new file mode 100644 index 0000000..0b70887 --- /dev/null +++ b/localization/day1/nightmareDay1.json @@ -0,0 +1,54 @@ +{ + "shadow": { + "introduction": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation" + }, + "continuation": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "startNightmare1": {} + } + ] + } + }, + "outro": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "type": "text", + "character": "shadow", + "next": "continuation3" + }, + "continuation3": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "finishNightmare1": {} + } + ] + } + } + } +} \ No newline at end of file diff --git a/localization/day2/nightmareDay2.json b/localization/day2/nightmareDay2.json new file mode 100644 index 0000000..1bfcbeb --- /dev/null +++ b/localization/day2/nightmareDay2.json @@ -0,0 +1,54 @@ +{ + "shadow": { + "introduction": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "startNightmare2": {} + } + ] + } + }, + "outro": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "finishNightmare2": {} + } + ] + } + } + } +} \ No newline at end of file diff --git a/localization/day3/nightmareDay3.json b/localization/day3/nightmareDay3.json new file mode 100644 index 0000000..8fc8a18 --- /dev/null +++ b/localization/day3/nightmareDay3.json @@ -0,0 +1,214 @@ +{ + "shadow": { + "introduction": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "startNightmare3": {} + } + ] + } + }, + "outro": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "type": "text", + "character": "shadow", + "next": "continuation3" + }, + "continuation3": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "finishNightmare3": {} + } + ] + } + } + }, + "Maria": { + "root": { + "type": "text", + "character": "Maria", + "next": "playerWorry" + }, + "playerWorry": { + "type": "choice", + "choices": [ + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + } + ] + }, + "characterDisappears": { + "type": "event", + "events": [ + { + "fadeOut": { + "character": "Maria" + } + } + ] + } + }, + "Guille": { + "root": { + "type": "text", + "character": "Guille", + "next": "playerWorry" + }, + "playerWorry": { + "type": "choice", + "choices": [ + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + } + ] + }, + "characterDisappears": { + "type": "event", + "events": [ + { + "fadeOut": { + "character": "Guille" + } + } + ] + } + }, + "Jose": { + "root": { + "type": "text", + "character": "Jose", + "next": "playerWorry" + }, + "playerWorry": { + "type": "choice", + "choices": [ + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + } + ] + }, + "characterDisappears": { + "type": "event", + "events": [ + { + "fadeOut": { + "character": "Jose" + } + } + ] + } + }, + "Alison": { + "root": { + "type": "text", + "character": "Alison", + "next": "playerWorry" + }, + "playerWorry": { + "type": "choice", + "choices": [ + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + } + ] + }, + "characterDisappears": { + "type": "event", + "events": [ + { + "fadeOut": { + "character": "Alison" + } + } + ] + } + }, + "Ana": { + "root": { + "type": "text", + "character": "Ana", + "next": "playerWorry" + }, + "playerWorry": { + "type": "choice", + "choices": [ + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + }, + { + "next": "characterDisappears" + } + ] + }, + "characterDisappears": { + "type": "event", + "events": [ + { + "fadeOut": { + "character": "Ana" + } + } + ] + } + } +} \ No newline at end of file diff --git a/localization/day4/nightmareDay4.json b/localization/day4/nightmareDay4.json new file mode 100644 index 0000000..c688b63 --- /dev/null +++ b/localization/day4/nightmareDay4.json @@ -0,0 +1,58 @@ +{ + "shadow": { + "introduction": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "startNightmare4": {} + } + ] + } + }, + "outro": { + "root": { + "type": "text", + "character": "shadow", + "next": "continuation1" + }, + "continuation1": { + "type": "text", + "character": "shadow", + "next": "continuation2" + }, + "continuation2": { + "type": "text", + "character": "shadow", + "next": "continuation3" + }, + "continuation3": { + "type": "text", + "character": "shadow", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "finishNightmare4": {} + } + ] + } + } + } +} \ No newline at end of file diff --git a/localization/day5/nightmareDay5.json b/localization/day5/nightmareDay5.json new file mode 100644 index 0000000..ec7694c --- /dev/null +++ b/localization/day5/nightmareDay5.json @@ -0,0 +1,193 @@ +{ + "root": { + "type": "choice", + "conditions": [ + { + "next": "badEnding", + "ending1": { + "value": 1, + "operator": "equal", + "global": "true", + "default": 0 + } + }, + { + "next": "normalEnding", + "ending2": { + "value": 2, + "operator": "equal", + "global": "true", + "default": 0 + } + }, + { + "next": "goodEnding", + "ending3": { + "value": 3, + "operator": "equal", + "global": "true", + "default": 0 + } + } + ] + }, + "badEnding": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart2" + }, + "badEndingPart2": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart3" + }, + "badEndingPart3": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart4" + }, + "badEndingPart4": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart5" + }, + "badEndingPart5": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart6" + }, + "badEndingPart6": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart7" + }, + "badEndingPart7": { + "type": "text", + "character": "portalVoice", + "next": "badEndingPart8" + }, + "badEndingPart8": { + "type": "text", + "character": "portalVoice", + "next": "playerQuestion" + }, + "normalEnding": { + "type": "text", + "character": "portalVoice", + "next": "normalEnding2" + }, + "normalEnding2": { + "type": "text", + "character": "portalVoice", + "next": "normalEnding3" + }, + "normalEnding3": { + "type": "text", + "character": "portalVoice", + "next": "normalEnding4" + }, + "normalEnding4": { + "type": "text", + "character": "portalVoice", + "next": "normalEnding5" + }, + "normalEnding5": { + "type": "text", + "character": "portalVoice", + "next": "normalEnding6" + }, + "normalEnding6": { + "type": "text", + "character": "portalVoice", + "next": "normalEnding7" + }, + "normalEnding7": { + "type": "text", + "character": "portalVoice", + "next": "playerQuestion" + }, + "goodEnding": { + "type": "text", + "character": "portalVoice", + "next": "goodEnding2" + }, + "goodEnding2": { + "type": "text", + "character": "portalVoice", + "next": "goodEnding3" + }, + "goodEnding3": { + "type": "text", + "character": "portalVoice", + "next": "goodEnding4" + }, + "goodEnding4": { + "type": "text", + "character": "portalVoice", + "next": "goodEnding5" + }, + "goodEnding5": { + "type": "text", + "character": "portalVoice", + "next": "goodEnding6" + }, + "goodEnding6": { + "type": "text", + "character": "portalVoice", + "next": "goodEnding7" + }, + "goodEnding7": { + "type": "text", + "character": "portalVoice", + "next": "playerQuestion" + }, + "playerQuestion": { + "type": "choice", + "choices": [ + { + "next": "curiousAnswer" + }, + { + "next": "unpoliteAnswer" + } + ] + }, + "curiousAnswer": { + "type": "text", + "character": "portalVoice", + "next": "curiousAnswerPart2" + }, + "curiousAnswerPart2": { + "type": "text", + "character": "portalVoice", + "next": "curiousAnswerPart3" + }, + "curiousAnswerPart3": { + "type": "text", + "character": "portalVoice", + "next": "curiousAnswerPart4" + }, + "curiousAnswerPart4": { + "type": "text", + "character": "portalVoice", + "next": "end" + }, + "unpoliteAnswer": { + "type": "text", + "character": "portalVoice", + "next": "unpoliteAnswerPart2" + }, + "unpoliteAnswerPart2": { + "type": "text", + "character": "portalVoice", + "next": "end" + }, + "end": { + "type": "event", + "events": [ + { + "endGame": {} + } + ] + } +} \ No newline at end of file diff --git a/localization/en/day1/nightmareDay1.json b/localization/en/day1/nightmareDay1.json new file mode 100644 index 0000000..4e3054f --- /dev/null +++ b/localization/en/day1/nightmareDay1.json @@ -0,0 +1,26 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "Your first day of school. Why don't you take a seat?" + }, + "continuation": { + "text": "Pick the seat you like the most." + } + }, + "outro": { + "root": { + "text": "I think you missed your seat." + }, + "continuation1": { + "text": "Don't you even know how to sit down?" + }, + "continuation2": { + "text": "Do you even worth anything?" + }, + "continuation3": { + "text": "How do you expect to make friends acting like this?" + } + } + } +} \ No newline at end of file diff --git a/localization/en/day2/nightmareDay2.json b/localization/en/day2/nightmareDay2.json new file mode 100644 index 0000000..000f4da --- /dev/null +++ b/localization/en/day2/nightmareDay2.json @@ -0,0 +1,26 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "So...have we already worked out this?" + }, + "continuation1": { + "text": "Do you know where to sit down?" + }, + "continuation2": { + "text": "Perhaps you should avoid those gums to fall on the chairs by hitting them or you'll have to sit down on one of them." + } + }, + "outro": { + "root": { + "text": "You'll have to sit down on a gum." + }, + "continuation1": { + "text": "Hahaha, go on, sit down." + }, + "continuation3": { + "text": "Come on, what are you waiting for?" + } + } + } +} \ No newline at end of file diff --git a/localization/en/day3/nightmareDay3.json b/localization/en/day3/nightmareDay3.json new file mode 100644 index 0000000..e8dec2b --- /dev/null +++ b/localization/en/day3/nightmareDay3.json @@ -0,0 +1,109 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "I'm going to make sure nobody talks to you." + }, + "continuation1": { + "text": "You can do whatever you want, but you won't get anything." + }, + "continuation2": { + "text": "Go on, talk to people in class, let's see if you get them to talk to you." + } + }, + "outro": { + "root": { + "text": "I think you have been left alone." + }, + "continuation1": { + "text": "How does it feel to be ignored by everybody?" + }, + "continuation2": { + "text": "Isn't it funny that none cares about you?" + }, + "continuation3": { + "text": "Because I'm cracking up just looking at you." + } + } + }, + "Maria": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "Are you gonna ignore me too?" + }, + { + "text": "Didn't they do the same to you? Don't ignore me, you know how it feels." + }, + { + "text": "You get me, right?" + } + ] + }, + "Guille": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "You're my friend, right?" + }, + { + "text": "William, you're not like the others." + }, + { + "text": "Don't let them threaten you." + } + ] + }, + "Jose": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "Are you gonna ignore me without a reason? Just because someone has told you to do so?" + }, + { + "text": "We can be friends." + }, + { + "text": "How old are you? Three years? Talk to me" + } + ] + }, + "Alison": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "Are you my friend, right?" + }, + { + "text": "You seem nicke, you aren't gonna stop talking to me, right?" + }, + { + "text": "Please, talk to me." + } + ] + }, + "Ana": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "What have I done to you? Why do you come after me?" + }, + { + "text": "If Alex jumps off a bridge, are you gonna jump off too?" + }, + { + "text": "Can't we just get along?" + } + ] + } +} \ No newline at end of file diff --git a/localization/en/day4/nightmareDay4.json b/localization/en/day4/nightmareDay4.json new file mode 100644 index 0000000..d31ae0c --- /dev/null +++ b/localization/en/day4/nightmareDay4.json @@ -0,0 +1,33 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "Don't you like the new photos that we have published?" + }, + "continuation1": { + "text": "You can try to delete them..." + }, + "continuation2": { + "text": "You're gonna have to do mor than just deleting or reporting them." + }, + "continuation3": { + "text": "Go on, try it...but we all already have a copy." + } + }, + "outro": { + "root": { + "text": "You haven't got anything." + }, + "continuation1": { + "text": "Hahahaha." + }, + "continuation2": { + "text": "Photos are still there." + }, + "continuation3": { + "text": "Once online, everyone can make a copy." + } + } + }, + "imageText": "Report photo" +} \ No newline at end of file diff --git a/localization/en/day5/nightmareDay5.json b/localization/en/day5/nightmareDay5.json new file mode 100644 index 0000000..f1fdb36 --- /dev/null +++ b/localization/en/day5/nightmareDay5.json @@ -0,0 +1,94 @@ +{ + "badEnding": { + "text": "Al final todo ha acabado igual, no se puede decir que no lo haya intentado." + }, + "badEndingPart2": { + "text": "Supongo que ya es tarde, has desaprovechado la oportunidad que te he dado." + }, + "badEndingPart3": { + "text": "Álex y Ana seguirán haciendo la vida imposible a otros compañeros. Tú no has sido su primera víctima, ni la última." + }, + "badEndingPart4": { + "text": "Tan difícil es pedir ayuda cuando uno la necesita. Olvidarse de nuestro ego. Uno no siempre tiene la culpa de lo que le pasa ni se lo merece." + }, + "badEndingPart5": { + "text": "¿Por qué ese miedo a compartir lo que te sucede, lo que uno siente?" + }, + "badEndingPart6": { + "text": "¿Por qué dejamos que las personas sufran? ¿Por qué pensamos que es mejor permanecer callado, que el tiempo todo lo cura?" + }, + "badEndingPart7": { + "text": "Es fácil reírse de los demás, pero qué pasa cuando el afectado eres tú." + }, + "badEndingPart8": { + "text": "¿Por qué es mejor sufrir o ver a los demás pasarlo mal que pedir ayuda? ¿Acaso pedir ayuda es chivarse? ¿Es chivarse evitar que alguien lo pase mal?" + }, + "normalEnding": { + "text": "Parece que al final no he conseguido mi propósito, pero al menos han mejorado un poco las cosas." + }, + "normalEnding2": { + "text": "Alex ahora estará vigilado y al menos os dejará a todos un poco más en paz." + }, + "normalEnding3": { + "text": "Hay que pedir ayuda cuando uno la necesita. Olvidarse de nuestro ego. Uno no siempre tiene la culpa de lo que le pasa o se lo merece." + }, + "normalEnding4": { + "text": "El tiempo no va a solucionar las cosas si sufres, no hay que dejarlo pasar." + }, + "normalEnding5": { + "text": "Todos necesitamos ayuda alguna vez y espero que al menos ahora seas consciente de que al igual que hay personas que te ayudan, hay otras que necesitan que tú les ayudes." + }, + "normalEnding6": { + "text": "¿Acaso es mejor sufrir o ver a los demás pasarlo mal que pedir ayuda? ¿Acaso pedir ayuda es chivarse? ¿Es chivarse evitar que alguien lo pase mal?" + }, + "normalEnding7": { + "text": "Espero que con lo que has vivido pierdas ese miedo a contar las cosas malas que os pasan a ti y a tus compañeros." + }, + "goodEnding": { + "text": "Bien, hemos conseguido cambiar las cosas." + }, + "goodEnding2": { + "text": "Aún no lo sabes, pero hemos conseguido que Alex deje en paz a sus compañeros y a ti." + }, + "goodEnding3": { + "text": "Si nadie le hubiera parado los pies tu no habrías sido la última persona en sufrir acoso." + }, + "goodEnding4": { + "text": "Es bueno contar las cosas, pedir ayuda. Nadie se merece que lo marginen, humillen o se burlen de él, sea cual sea el motivo." + }, + "goodEnding5": { + "text": "Habrá gente que diga que te chivaste al profesor, a los compañeros o a tus padres. Yo opino que has sido un héroe." + }, + "goodEnding6": { + "text": "Espero que nunca más te quedes callado si alguien necesita ayuda o sufre. Que le des tu apoyo en vez de seguir al matón de turno." + }, + "goodEnding7": { + "text": "Es fácil no hacer nada, pero has pensado que tu puedes ser su siguiente víctima como ha pasado ahora." + }, + "playerQuestion": [ + { + "text": "¿Quién eres?" + }, + { + "text": "Deja de decir estupideces y desaparece." + } + ], + "curiousAnswer": { + "text": "Me temo que eso no puedo decírtelo." + }, + "curiousAnswerPart2": { + "text": "Piensa en mí como alguien que está CONECTADO a ti por aquello que tenemos en común." + }, + "curiousAnswerPart3": { + "text": "Quizá una voz de la conciencia..." + }, + "curiousAnswerPart4": { + "text": "Pero poco importa quien yo sea. Lo importante es que lo que has vivido te ha hecho reflexionar y ser mejor persona." + }, + "unpoliteAnswer": { + "text": "Siento que mi presencia no te resulte cómoda." + }, + "unpoliteAnswerPart2": { + "text": "Y que quizá esto no haya servido para nada..." + } +} \ No newline at end of file diff --git a/localization/en/names.json b/localization/en/names.json index 7a9246c..4f9e28e 100644 --- a/localization/en/names.json +++ b/localization/en/names.json @@ -1,16 +1,14 @@ { "player": "You", - "mom": "Mom", "dad": "Dad", - "Maria": "Mary", "Alex": "Alex", "Alison": "Alison", "Guille": "William", - "teacher": "Teacher", "computer": "Computer", - "note": "Note" - + "note": "Note", + "shadow": "Shadow", + "portalVoice": "Voice from the portal" } \ No newline at end of file diff --git a/localization/es/day1/nightmareDay1.json b/localization/es/day1/nightmareDay1.json new file mode 100644 index 0000000..f32b69e --- /dev/null +++ b/localization/es/day1/nightmareDay1.json @@ -0,0 +1,26 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "Tu primer día de clase. ¿Por qué no te sientas?" + }, + "continuation": { + "text": "Escoge el sitio que más te guste." + } + }, + "outro": { + "root": { + "text": "Me parece que te has quedado sin sitio." + }, + "continuation1": { + "text": "¿Ni siquiera sabes sentarte?" + }, + "continuation2": { + "text": "¿Acaso no sirves para nada?" + }, + "continuation3": { + "text": "¿Cómo esperas hacer así amigos?" + } + } + } +} \ No newline at end of file diff --git a/localization/es/day2/nightmareDay2.json b/localization/es/day2/nightmareDay2.json new file mode 100644 index 0000000..ea46df0 --- /dev/null +++ b/localization/es/day2/nightmareDay2.json @@ -0,0 +1,26 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "Bueno...¿ya lo hemos solucionado no?" + }, + "continuation1": { + "text": "¿Sabes dónde sentarte?" + }, + "continuation2": { + "text": "Quizás deberías evitar que lo chicles caigan en la silla golpeándolos o tendrás que sentarte en uno." + } + }, + "outro": { + "root": { + "text": "Tendrás que sentarte en un chicle." + }, + "continuation1": { + "text": "Jajaja, adelante, siéntate." + }, + "continuation3": { + "text": "Venga, ¿a qué esperas?" + } + } + } +} \ No newline at end of file diff --git a/localization/es/day3/nightmareDay3.json b/localization/es/day3/nightmareDay3.json new file mode 100644 index 0000000..211e3a2 --- /dev/null +++ b/localization/es/day3/nightmareDay3.json @@ -0,0 +1,111 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "Voy a hacer que nadie te quiera hablar." + }, + "continuation1": { + "text": "Puedes decir lo que quieras, pero no conseguirás nada." + }, + "continuation2": { + "text": "Adelante, habla con la gente de clase, a ver si consigues que te hablen." + } + }, + "outro": { + "root": { + "text": "", + "text_male": "Me parece que te has quedado solo.", + "text_female": "Me parece que te has quedado sola." + }, + "continuation1": { + "text": "¿Qué tal sienta que todos te ignoren?" + }, + "continuation2": { + "text": "¿No te parece divertido que nadie te haga caso?" + }, + "continuation3": { + "text": "Porque yo me estoy partiendo de solo verte." + } + } + }, + "Maria": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "¿Tú también me vas a ignorar?" + }, + { + "text": "¿No te habían hecho lo mismo? No me ignores, sabes lo que se siente." + }, + { + "text": "Tú me entiendes, ¿verdad?" + } + ] + }, + "Guille": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "Tú eres mi amigo no, ¿no?" + }, + { + "text": "Guille, tú no eres como los demás." + }, + { + "text": "No dejes que te amenacen." + } + ] + }, + "Jose": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "¿Vas a ignorarme sin motivo? ¿Solo por qué te han dicho que lo hagas?" + }, + { + "text": "Podemos ser amigos." + }, + { + "text": "Tienes 3 años? Dime algo." + } + ] + }, + "Alison": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "Eres mi amiga, ¿no?" + }, + { + "text": "Eres maja, no me vas a dejar de hablar, ¿verdad?" + }, + { + "text": "Por favor, dime algo." + } + ] + }, + "Ana": { + "root": { + "text": "..." + }, + "playerWorry": [ + { + "text": "¿Qué te he hecho? ¿Por qué vas a por mi también?" + }, + { + "text": "Si Alex se tira de un puente, ¿también te tirás tú?" + }, + { + "text": "¿No podemos llevarnos bien?" + } + ] + } +} \ No newline at end of file diff --git a/localization/es/day4/nightmareDay4.json b/localization/es/day4/nightmareDay4.json new file mode 100644 index 0000000..66f8e65 --- /dev/null +++ b/localization/es/day4/nightmareDay4.json @@ -0,0 +1,33 @@ +{ + "shadow": { + "introduction": { + "root": { + "text": "¿No te gustan las nuevas fotos que hemos publicado?" + }, + "continuation1": { + "text": "Puedes intentar borrarlas..." + }, + "continuation2": { + "text": "Vas a tener que hacer algo más a parte de borrarlas o denunciarlas." + }, + "continuation3": { + "text": "Venga...prueba a ver, pero todos tenemos una copia ya." + } + }, + "outro": { + "root": { + "text": "No has conseguido nada." + }, + "continuation1": { + "text": "Jajajaja." + }, + "continuation2": { + "text": "Las fotos siguen ahí." + }, + "continuation3": { + "text": "Una vez en internet, cualquiera puede hacer una copia." + } + } + }, + "imageText": "Denunciar foto" +} \ No newline at end of file diff --git a/localization/es/day5/nightmareDay5.json b/localization/es/day5/nightmareDay5.json new file mode 100644 index 0000000..f1fdb36 --- /dev/null +++ b/localization/es/day5/nightmareDay5.json @@ -0,0 +1,94 @@ +{ + "badEnding": { + "text": "Al final todo ha acabado igual, no se puede decir que no lo haya intentado." + }, + "badEndingPart2": { + "text": "Supongo que ya es tarde, has desaprovechado la oportunidad que te he dado." + }, + "badEndingPart3": { + "text": "Álex y Ana seguirán haciendo la vida imposible a otros compañeros. Tú no has sido su primera víctima, ni la última." + }, + "badEndingPart4": { + "text": "Tan difícil es pedir ayuda cuando uno la necesita. Olvidarse de nuestro ego. Uno no siempre tiene la culpa de lo que le pasa ni se lo merece." + }, + "badEndingPart5": { + "text": "¿Por qué ese miedo a compartir lo que te sucede, lo que uno siente?" + }, + "badEndingPart6": { + "text": "¿Por qué dejamos que las personas sufran? ¿Por qué pensamos que es mejor permanecer callado, que el tiempo todo lo cura?" + }, + "badEndingPart7": { + "text": "Es fácil reírse de los demás, pero qué pasa cuando el afectado eres tú." + }, + "badEndingPart8": { + "text": "¿Por qué es mejor sufrir o ver a los demás pasarlo mal que pedir ayuda? ¿Acaso pedir ayuda es chivarse? ¿Es chivarse evitar que alguien lo pase mal?" + }, + "normalEnding": { + "text": "Parece que al final no he conseguido mi propósito, pero al menos han mejorado un poco las cosas." + }, + "normalEnding2": { + "text": "Alex ahora estará vigilado y al menos os dejará a todos un poco más en paz." + }, + "normalEnding3": { + "text": "Hay que pedir ayuda cuando uno la necesita. Olvidarse de nuestro ego. Uno no siempre tiene la culpa de lo que le pasa o se lo merece." + }, + "normalEnding4": { + "text": "El tiempo no va a solucionar las cosas si sufres, no hay que dejarlo pasar." + }, + "normalEnding5": { + "text": "Todos necesitamos ayuda alguna vez y espero que al menos ahora seas consciente de que al igual que hay personas que te ayudan, hay otras que necesitan que tú les ayudes." + }, + "normalEnding6": { + "text": "¿Acaso es mejor sufrir o ver a los demás pasarlo mal que pedir ayuda? ¿Acaso pedir ayuda es chivarse? ¿Es chivarse evitar que alguien lo pase mal?" + }, + "normalEnding7": { + "text": "Espero que con lo que has vivido pierdas ese miedo a contar las cosas malas que os pasan a ti y a tus compañeros." + }, + "goodEnding": { + "text": "Bien, hemos conseguido cambiar las cosas." + }, + "goodEnding2": { + "text": "Aún no lo sabes, pero hemos conseguido que Alex deje en paz a sus compañeros y a ti." + }, + "goodEnding3": { + "text": "Si nadie le hubiera parado los pies tu no habrías sido la última persona en sufrir acoso." + }, + "goodEnding4": { + "text": "Es bueno contar las cosas, pedir ayuda. Nadie se merece que lo marginen, humillen o se burlen de él, sea cual sea el motivo." + }, + "goodEnding5": { + "text": "Habrá gente que diga que te chivaste al profesor, a los compañeros o a tus padres. Yo opino que has sido un héroe." + }, + "goodEnding6": { + "text": "Espero que nunca más te quedes callado si alguien necesita ayuda o sufre. Que le des tu apoyo en vez de seguir al matón de turno." + }, + "goodEnding7": { + "text": "Es fácil no hacer nada, pero has pensado que tu puedes ser su siguiente víctima como ha pasado ahora." + }, + "playerQuestion": [ + { + "text": "¿Quién eres?" + }, + { + "text": "Deja de decir estupideces y desaparece." + } + ], + "curiousAnswer": { + "text": "Me temo que eso no puedo decírtelo." + }, + "curiousAnswerPart2": { + "text": "Piensa en mí como alguien que está CONECTADO a ti por aquello que tenemos en común." + }, + "curiousAnswerPart3": { + "text": "Quizá una voz de la conciencia..." + }, + "curiousAnswerPart4": { + "text": "Pero poco importa quien yo sea. Lo importante es que lo que has vivido te ha hecho reflexionar y ser mejor persona." + }, + "unpoliteAnswer": { + "text": "Siento que mi presencia no te resulte cómoda." + }, + "unpoliteAnswerPart2": { + "text": "Y que quizá esto no haya servido para nada..." + } +} \ No newline at end of file diff --git a/localization/es/names.json b/localization/es/names.json index a634ce7..e416f59 100644 --- a/localization/es/names.json +++ b/localization/es/names.json @@ -1,15 +1,14 @@ { "player": "Tú", - "mom": "Mamá", "dad": "Papá", - "Maria": "María", "Alex": "Alex", "Alison": "Alison", "Guille": "Guille", - "teacher": "Profesor", "computer": "Ordenador", - "note": "Nota" + "note": "Nota", + "shadow": "Sombra", + "portalVoice": "Voz desde el portal" } \ No newline at end of file diff --git a/localization/es/test/computerTest.json b/localization/es/test/computerTest.json new file mode 100644 index 0000000..3ab7306 --- /dev/null +++ b/localization/es/test/computerTest.json @@ -0,0 +1,36 @@ +{ + "root": { + "text": "No tengo nada que publicar" + }, + "Alison": { + "refuse": { + "root": { + "text": "¿Debería borrarla?" + }, + "decision": [ + { + "text": "Sí" + }, + { + "text": "No" + } + ] + }, + "post": { + "root": [ + { + "text": "Comentar" + }, + { + "text": "Nada" + }, + { + "text": "Borrar el post" + } + ], + "comment": { + "text": "Lindo día" + } + } + } +} \ No newline at end of file diff --git a/localization/posts.json b/localization/posts.json index 9241660..964d68c 100644 --- a/localization/posts.json +++ b/localization/posts.json @@ -1,35 +1,35 @@ { - "Alison": { + "player": { "post0": { "photo": "photoMatch", - "friendShipRequired": true + "friendshipRequired": true } }, "Maria": { "post0": { "photo": "photoMatch", - "friendShipRequired": true + "friendshipRequired": true } }, "Alex": { "post0": { "photo": "photoMatch", - "friendShipRequired": true + "friendshipRequired": true } }, "Guille": { "post0": { "photo": "photoMatch", - "friendShipRequired": false + "friendshipRequired": false } }, - "player": { - "photo": { - "male": "photoMatch", - "female": "photoMatch" - }, + "Alison": { "post0": { - "friendShipRequired": false + "photo": { + "male": "photoForeheadBoy", + "female": "photoForeheadGirl" + }, + "friendshipRequired": true } } } \ No newline at end of file diff --git a/localization/test/computerTest.json b/localization/test/computerTest.json new file mode 100644 index 0000000..f9287e5 --- /dev/null +++ b/localization/test/computerTest.json @@ -0,0 +1,65 @@ +{ + "root": { + "type": "text", + "character": "player" + }, + "Alison": { + "refuse": { + "root": { + "type": "text", + "character": "player", + "next": "decision" + }, + "decision": { + "type": "choice", + "choices": [ + { + "next": "eraseFriendRequest" + }, + {} + ] + }, + "eraseFriendRequest": { + "type": "event", + "events": [ + { + "eraseFriendRequest": { + "character": "Alison" + } + } + ] + } + }, + "post": { + "root": { + "type": "choice", + "choices": [ + { + "next": "comment" + }, + {}, + { + "next": "erasePost" + } + ] + }, + "comment": { + "type": "socialNetMessage", + "character": "Maria", + "user": "Alison", + "postName": "post0" + }, + "erasePost": { + "type": "event", + "events": [ + { + "erasePost": { + "character": "Alison", + "postName": "post0" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/UI/computer/feedTab.js b/src/UI/computer/feedTab.js index 8112199..33b35fe 100644 --- a/src/UI/computer/feedTab.js +++ b/src/UI/computer/feedTab.js @@ -63,9 +63,12 @@ export default class FeedTab extends Phaser.GameObjects.Group { * @param {Post} post */ addPostToList(post) { - post.setVisible(true); // Los posts se van anadiendo al principio this.listView.addFirstItem(post, [post.commentButton.hit], [post.listView]); + // Se hace invisible porque cuando se acepta una solicitud de amistad se anaden todos los posts pendientes + // a la listview y esta al recolocarlos va a volver los colliders visibles. Sin embargo, aunque se sigue + // en la pestana de solicitudes de amistad y estos colliders deberian ser invisibles + post.setVisible(false); } /** diff --git a/src/UI/computer/friendRequest.js b/src/UI/computer/friendRequest.js index 69f79cd..4954c5c 100644 --- a/src/UI/computer/friendRequest.js +++ b/src/UI/computer/friendRequest.js @@ -118,7 +118,7 @@ export default class FriendRequest extends Phaser.GameObjects.Container { // Boton para aceptar la peticion de amistad this.refuseButton = new ListViewButton(this.scene, this.acceptButton.x - this.acceptButton.w, this.acceptButton.y, size, () => { if (this.refuseNode !== null) { - gameManager.dialogManager.setNode(this.refuseNode); + gameManager.UIManager.dialogManager.setNode(this.refuseNode); } else { defaultRefuseFn(); @@ -182,6 +182,7 @@ export default class FriendRequest extends Phaser.GameObjects.Container { this.hitButtons.forEach((button) => { hits.push(button.hit); }); + return hits; } /** diff --git a/src/UI/computer/friendsTab.js b/src/UI/computer/friendsTab.js index 17a57f9..8115ae5 100644 --- a/src/UI/computer/friendsTab.js +++ b/src/UI/computer/friendsTab.js @@ -178,6 +178,7 @@ export default class FriendsTab extends Phaser.GameObjects.Group { // Se agrega la peticion de amistad tanto a la listview como a la lista de peticiones this.listView.addLastItem(friendRequest, friendRequest.getHits()); + this.existingRequests.add(friendRequest); // Aumenta el numero de peticiones this.increaseFriendRequests(); diff --git a/src/UI/computer/post.js b/src/UI/computer/post.js index 28a306b..184fa3f 100644 --- a/src/UI/computer/post.js +++ b/src/UI/computer/post.js @@ -80,7 +80,7 @@ export default class Post extends Phaser.GameObjects.Container { offset = 10; this.commentButton = new ListViewButton(this.scene, photoBg.x + photoBg.displayWidth / 2 - offset, photoBg.y + offset, 0.65, () => { if (this.commentNode !== null) { - gameManager.dialogManager.setNode(this.commentNode); + gameManager.UIManager.dialogManager.setNode(this.commentNode); } }, { atlas: 'computerElements', frame: 'addComment' }, { x: 1, y: 1 }, { R: 255, G: 255, B: 255 }, { R: 200, G: 200, B: 200 }, { R: 150, G: 150, B: 150 }); this.commentButton.x -= this.commentButton.w / 2; diff --git a/src/UI/computer/socialNetworkScreen.js b/src/UI/computer/socialNetworkScreen.js index 2706efc..9bd4695 100644 --- a/src/UI/computer/socialNetworkScreen.js +++ b/src/UI/computer/socialNetworkScreen.js @@ -19,11 +19,11 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { // Administrar todo lo relacionado con los amigos // Solicitud de amistad, posts que van a aparecer si se acepta la solicitud... - this.friends = new Set(); + this.friends = new Map(); this.screenName = 'socialNetScreen'; - let dialogManager = this.scene.gameManager.dialogManager; + let dialogManager = this.scene.gameManager.UIManager.dialogManager; // Fondo de login del ordenador let mainViewBg = this.scene.add.image(0.23 * this.scene.CANVAS_WIDTH / 5, 4.1 * this.scene.CANVAS_HEIGHT / 5, 'computerMainView'); @@ -92,7 +92,7 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { let post = friendInfo.posts.get(postInfo.postName); this.feedTab.erasePost(post); // Tiene que ir despues - this.erasePost(postInfo.character); + this.erasePost(postInfo.character, postInfo.postName); } } }); @@ -301,18 +301,19 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { if (!this.friends.has(character)) { let friendInfo = { request: null, - posts: new Map() + posts: new Map(), + pendingPosts: [] }; this.friends.set(character, friendInfo); } } /** - * PUBLICA + * PUBLICO * Establecer el nodo del dialogmanaager que aparece cuando se quiere publicar algo * @param {Node} node */ - setOwnPost(node) { + setOwnPostNode(node) { this.ownPostNode = node; } @@ -320,13 +321,13 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { /** - * PUBLICA + * PUBLICO * Agregar una solicitud de amistad de un personaje * @param {String} character */ addFriendRequest(character) { // Se trata de crear su info - this.tryToCreateFriendInfo(); + this.tryToCreateFriendInfo(character); // Se anade la solicitud let friendRequest = this.friendsTab.addFriendRequest(character); @@ -345,7 +346,7 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { let friendInfo = this.friends.get(character); // Se eliminan todos los posts que el usuario tenian subidos, // aunque no se habian mostrado porque el jugador no acepto la solicitud - friendInfo.posts((post, num) => { + friendInfo.posts.forEach((post, num) => { post.destroy(); }) this.friends.delete(character); @@ -353,8 +354,9 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { } /** - * PUBLICA + * PUBLICO * Establecer el nodo del dialogmanager que aparece cuando se se trata de rechazar una solicitud de amistad + * Nota: tiene que existir la peticion de amistad del personaje * @param {Node} node */ setRefuseNode(character, node) { @@ -371,7 +373,7 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { // ANADIR/ELIMINAR PUBLICACION // /** - * PUBLICACION + * PUBLICO * Se anade un post * @param {String} character - personaje * @param {String} postName - nombre del post @@ -383,24 +385,26 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { this.tryToCreateFriendInfo(character); // Informacion del post - let photo = this.posts[character][postName].photo; - // La foto que se sube varia en funcion del genero del jugador - if (!photo instanceof String) { - photo = this.posts[character][postName][this.scene.userInfo.gender]; - } - let friendShipRequired = this.post[character][postName].friendShipRequired; - let description = this.scene.i18next.t(character + "." + postName, { ns: "posts" }); + let friendInfo = this.friends.get(character); + if (!friendInfo.posts.has(postName)) { + let postInfo = this.posts[character][postName]; + let photo = postInfo.photo; + // La foto que se sube varia en funcion del genero del jugador + let check = photo instanceof String; + if (!check) { + photo = postInfo.photo[this.scene.userInfo.gender]; + } + let friendshipRequired = postInfo.friendshipRequired; + let description = this.scene.i18next.t(character + "." + postName, { ns: "posts" }); - // Se crea el post - let post = this.feedTab.createPost(character, photo, description); + // Se crea el post + let post = this.feedTab.createPost(character, photo, description); - if (this.friends.has(character)) { // Se anade a la lista de posts del usuario friendInfo.posts.set(postName, post); - // Se comprueba si el jugador ha aceptado la solicitud // y, entonces se puede anadir el post al tablon - this.tryToAddPost(character, post, friendShipRequired); + this.tryToAddPost(character, post, friendshipRequired); } } @@ -412,21 +416,34 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { * (tp es necesario siquiera que haya enviado una solicitud de amistad) */ tryToAddPost(character, post, friendShipRequired) { + let pendingPost = true; + if (this.friends.has(character)) { let friendInfo = this.friends.get(character); // Si existe la solicitud de amistad if (friendInfo.request) { // Si se ha aceptado if (friendInfo.request.isAccepted) { - // Entonces, se anade a la listview + // Se anade directamente a la listview + pendingPost = false; this.feedTab.addPostToList(post); } } - // Si no existe solicitud de amistad - // Publicacion que se muestra directamente (propio personaje u otro usuario) - else if (character == "player" || !friendShipRequired) { + + // Se muestra directamente la publicacion (personaje u otro personaje) + // Nota: aunque un personaje haya enviado una solicitud de amistad, puede + // seguir mostrando publicacion directas + if (character == "player" || (friendShipRequired !== undefined && friendShipRequired === false)) { + // Se ana directamente a la listview + pendingPost = false; this.feedTab.addPostToList(post); } + + // El personaje ha subido una publicacion, pero no se va a mostrar + // hasta que se acepte la solicitud de amistad + if (pendingPost) { + friendInfo.pendingPosts.push(post); + } } } @@ -437,9 +454,10 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { addPendingPosts(character) { let friendInfo = this.friends.get(character); // Los posts pendientes que no se han anadido son los que habia hasta el momento en el map - friendInfo.post.forEach((post, num) => { - this.tryToAddPostToFeed(character, post); + friendInfo.pendingPosts.forEach((post, num) => { + this.feedTab.addPostToList(post); }); + friendInfo.pendingPosts = []; } /** @@ -462,7 +480,7 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { // COMENTAR PUBLICACION // /** - * PUBLICA + * PUBLICO (DESDE EL DIALOG MANAGER) * Anadir comentario a una publicacion (tiene que existir la publicacion previamente) * @param {String} user - personaje que ha subido la publicacion * @param {String} postName - nombre de la publicacion @@ -482,7 +500,7 @@ export default class SocialNetworkScreen extends Phaser.GameObjects.Group { } /** - * PUBLICA + * PUBLICO * Establecer un nodo del dialogmanager que aparece al clicar el boton de comentario de un post * @param {String} character - personaje * @param {String} postName - post diff --git a/src/UI/dialog/dialogNode.js b/src/UI/dialog/dialogNode.js index 360dd8b..98dc12f 100644 --- a/src/UI/dialog/dialogNode.js +++ b/src/UI/dialog/dialogNode.js @@ -168,7 +168,7 @@ export class SocialNetNode extends DialogNode { this.type = "socialNetMessage"; this.text = null; // texto del mensaje - this.character = null; // id del personaje que publica escribe en la publicacion + this.character = null; // id del personaje que escribe en la publicacion this.name = null; // nombre del personaje que escribe en la publicacion (si se trata del jugador, es el pronombre personal Tu) this.user = null; // usuario que ha hecho la publicacion (corresponde con los ids de los personajes) this.postName = null; // nombre de la publicacion diff --git a/src/game.js b/src/game.js index 43a85b2..e98ae0f 100644 --- a/src/game.js +++ b/src/game.js @@ -24,7 +24,6 @@ import ComputerScene from './UI/computer/computerScene.js' import UIManager from './managers/UIManager.js'; import Test from './scenes/test.js'; -import TestMenu from './scenes/testMenu.js' const max_w = 1129, max_h = 847, min_w = 320, min_h = 240; @@ -40,8 +39,8 @@ const config = { BootScene, LanguageMenu, TitleMenu, UserInfoMenu, AlarmScene, BedroomMorningDay1, LivingroomMorningDay1, PlaygroundMorningDay1, StairsMorningDay1, CorridorMorningDay1, BathroomMorning, ClassFrontMorningDay1, ClassBackMorningDay1, - Test, TestMenu, - ComputerScene, UIManager, TextOnlyScene ], + Test, + ComputerScene, UIManager, TextOnlyScene], autoFocus: true, disableContextMenu: true, // Desactivar que aparezca el menu de inspeccionar al hacer click derecho render: { diff --git a/src/managers/gameManager.js b/src/managers/gameManager.js index 8dd4425..8642177 100644 --- a/src/managers/gameManager.js +++ b/src/managers/gameManager.js @@ -33,9 +33,6 @@ export default class GameManager { this.i18next = this.currentScene.plugins.get('rextexttranslationplugin'); this.dispatcher = EventDispatcher.getInstance(); - // Indica el dia del juego - this.day = 1; - // Blackboard de variables de todo el juego this.blackboard = new Map(); @@ -239,7 +236,7 @@ export default class GameManager { this.computerScene = this.currentScene.scene.get(computerSceneName); this.computerScene.scene.sleep(); - let sceneName = 'ClassBackMorningDay1'; + let sceneName = 'Test'; // let sceneName = 'BedroomMorningDay1'; // Pasa a la escena inicial con los parametros text, onComplete y onCompleteDelay diff --git a/src/scenes/bootScene.js b/src/scenes/bootScene.js index 973828b..9b29702 100644 --- a/src/scenes/bootScene.js +++ b/src/scenes/bootScene.js @@ -132,7 +132,21 @@ export default class BootScene extends Phaser.Scene { this.load.atlas('avatars', 'avatars.png', 'avatars.json'); } - loadPlugins() { + loadPlugins(dialogsAndNamespaces, onlyNamespaces) { + let namespaces = [...onlyNamespaces]; + + dialogsAndNamespaces.forEach((dialog) => { + let dialogWithoutExtension = dialog.substr(0, dialog.lastIndexOf('.')); + let dialogAux = dialogWithoutExtension.replace('/', '\\'); + namespaces.push(dialogAux); + }); + + /* + ['titleMenu', 'userInfoMenu', 'names', 'phoneInfo', 'computer', 'transitionScenes', 'everydayDialog', + 'day1\\bedroomMorningDay1', 'day1\\livingroomMorningDay1', 'day1\\playgroundMorningDay1', 'day1\\corridorMorningDay1', 'day1\\classFrontMorningDay1', 'day1\\ClassBackMorningDay1', + 'test\\momDialog', 'test\\dadDialog', 'test\\chat1', 'posts', 'test\\computerTest'] + */ + // Se inicializa el plugin i18next // Inicialmente solo se carga el idioma inicial y los de respaldo // Luego, conforme se usan tambien se cargan el resto @@ -146,9 +160,7 @@ export default class BootScene extends Phaser.Scene { // en cualquier idioma (aunque o existiese) supportedLngs: ['en', 'es'], // Namespaces que se cargan para cada uno de los idiomas - ns: ['titleMenu', 'userInfoMenu', 'names', 'phoneInfo', 'computer', 'transitionScenes', 'everydayDialog', - 'day1\\bedroomMorningDay1', 'day1\\livingroomMorningDay1', 'day1\\playgroundMorningDay1', 'day1\\corridorMorningDay1', 'day1\\classFrontMorningDay1', 'day1\\ClassBackMorningDay1', - 'test\\momDialog', 'test\\dadDialog', 'test\\chat1', 'posts'], + ns: namespaces, preload: ['en', 'es'], // Mostrar informacion de ayuda por consola debug: false, @@ -162,7 +174,7 @@ export default class BootScene extends Phaser.Scene { }) } - loadDialogs() { + loadDialogs(dialogsAndNamespaces) { this.load.setPath('assets/UI/dialog'); // Assets de la caja de texto y de opcion multiple @@ -188,6 +200,8 @@ export default class BootScene extends Phaser.Scene { // Archivos de dialogos (estructura) this.load.setPath('localization'); + + /* this.load.json('momDialog', 'test/momDialog.json'); this.load.json('dadDialog', 'test/dadDialog.json'); this.load.json('chat1', 'test/chat1.json'); @@ -202,6 +216,14 @@ export default class BootScene extends Phaser.Scene { this.load.json('corridorMorningDay1', 'day1/corridorMorningDay1.json'); this.load.json('classFrontMorningDay1', 'day1/classFrontMorningDay1.json'); this.load.json('ClassBackMorningDay1', 'day1/ClassBackMorningDay1.json'); + */ + + dialogsAndNamespaces.forEach((dialog) => { + let dialogWithoutExtension = dialog.substr(0, dialog.lastIndexOf('.')); + let subPaths = dialogWithoutExtension.split('/'); + let name = subPaths[subPaths.length - 1]; + this.load.json(name, dialog); + }); } @@ -298,10 +320,7 @@ export default class BootScene extends Phaser.Scene { this.load.atlas('classBack', 'classBack/classBack.png', 'classBack/classBack.json'); // Pesadillas - // this.load.image('nightmaresBg', 'nightmares/nightmaresBg.png'); - // this.load.image('gum', 'nightmares/gum.png'); - // this.load.image('gumChair', 'nightmares/gumChair.png'); - // this.load.image('nightmaresChair', 'nightmares/nightmaresChair.png'); + this.load.atlas('nightmares', 'nightmares/nightmaresElements.png', 'nightmares/nightmaresElements.json') } loadCreditsSceneAssets() { @@ -314,18 +333,47 @@ export default class BootScene extends Phaser.Scene { } preload() { + // Son tanto archivos de dialogos como namespaces del plugin i18next + // Ruta archivo dialogo --> test/momDialog.json + // Nombre archivo dialogo --> momDialog.json + // Namespace --> test\\momDialog.json + let dialogsAndNamespaces = [ + 'test/momDialog.json', + 'test/dadDialog.json', + 'test/chat1.json', + 'test/computerTest.json', + 'posts.json', + 'everydayDialog.json', + 'day1/bedroomMorningDay1.json', + 'day1/playgroundMorningDay1.json', + 'day1/corridorMorningDay1.json', + 'day1/classFrontMorningDay1.json', + 'day1/ClassBackMorningDay1.json' + ] + // Solo son namespaces del plugin i18next + // El nombre corresponde tal cual con el namespace (incluye \\ si es necesario) + let onlyNamespaces = [ + 'titleMenu', + 'userInfoMenu', + 'names', + 'phoneInfo', + 'computer', + 'transitionScenes', + 'everydayDialog' + ] + this.loadComputersAssets(); this.loadPhoneAssets(); this.loadFlags(); this.loadAvatars(); - this.loadDialogs(); + this.loadDialogs(dialogsAndNamespaces); this.loadCharacters(); this.loadBackgrounds(); this.loadCreditsSceneAssets(); this.load.setPath('assets'); - this.loadPlugins(); + this.loadPlugins(dialogsAndNamespaces, onlyNamespaces); } create() { diff --git a/src/scenes/gameLoop/baseScene.js b/src/scenes/gameLoop/baseScene.js index 87a456a..f5c76be 100644 --- a/src/scenes/gameLoop/baseScene.js +++ b/src/scenes/gameLoop/baseScene.js @@ -445,7 +445,7 @@ export default class BaseScene extends Phaser.Scene { node.user = fileObj[id].user; // Guarda el numero del post del usuario - node.postName = filed[id].postName; + node.postName = fileObj[id].postName; // Si hay un nodo despues de este, se crea de manera y se // guarda la id de dicho nodo en el array de nodos siguientes diff --git a/src/scenes/test.js b/src/scenes/test.js index 725e5fc..557d893 100644 --- a/src/scenes/test.js +++ b/src/scenes/test.js @@ -71,6 +71,17 @@ export default class Test extends BaseScene { chatName = this.i18next.t("textMessages.chat2", { ns: "phoneInfo", returnObjects: true }); this.phoneManager.phone.addChat(chatName, "Alex"); + let computerTest = this.cache.json.get('computerTest'); + let ownPostNode = super.readNodes(computerTest, "test\\computerTest", "", true); + let refuseNode = super.readNodes(computerTest, "test\\computerTest", "Alison.refuse", true); + let postNode = super.readNodes(computerTest, "test\\computerTest", "Alison.post", true); + let socialNetwork = this.gameManager.computerScene.socialNetScreen; + socialNetwork.setOwnPostNode(ownPostNode); + //socialNetwork.createPost('Alison', 'post0'); + socialNetwork.addFriendRequest('Alison'); + socialNetwork.createPost('Alison', 'post0'); + socialNetwork.setRefuseNode('Alison', refuseNode); + socialNetwork.setPostNode('Alison', 'post0', postNode); // Ordenador let computer = this.add.image(this.CANVAS_WIDTH / 2, this.CANVAS_HEIGHT / 2, 'bedroom', 'computer'); diff --git a/src/scenes/testMenu.js b/src/scenes/testMenu.js deleted file mode 100644 index f9f269d..0000000 --- a/src/scenes/testMenu.js +++ /dev/null @@ -1,56 +0,0 @@ -import VerticalListView from '../UI/listView/verticalListView.js' -import ListViewHit from '../UI/listView/listViewHit.js' - -export default class TestMenu extends Phaser.Scene { - constructor() { - super({ key: 'TestMenu' }); - } - - create() { - const CANVAS_WIDTH = this.sys.game.canvas.width; - const CANVAS_HEIGHT = this.sys.game.canvas.height; - - let v = this.createListView(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 - 200, 0.9); - let subV = this.createListView(0, 0, 0.8); - let subV2 = this.createListView(CANVAS_WIDTH / 2 - 400, CANVAS_HEIGHT / 2 - 200, 0.3); - v.addItem(subV, null, [subV]); - subV.addItem(subV2, null, [subV2]); - - let image = this.createImage(); - subV2.addItem(image); - - v.cropItems(); - - //subV.removeByIndex(2); - //subV.cropItems(); - - //v.removeByIndex(2); - //v.cropItems(); - } - - createListView(x, y, scale) { - let v = new VerticalListView(this, x, y, scale, 10, { width: 400, height: 400 }); - - // imagen 1 - let image = this.createImage(); - let hit = new ListViewHit(this, image); - hit.on('pointerdown', () => { - console.log("auch"); - }) - v.addItem(image, [hit]); - - // imagen 2 - image = this.createImage(); - v.addItem(image); - - return v; - } - - createImage() { - let image = this.add.image(0, 0, 'spFlag'); - image.setAlpha(0.5); - image.setScale(1.1); - image.h = image.displayHeight; - return image; - } -} \ No newline at end of file