Compare commits
No commits in common. "master" and "Nabil" have entirely different histories.
|
|
@ -28,11 +28,11 @@ Open Godot, in the project manager, select `Import`, choose the `project.godot`
|
|||
* [Godot Documentation](https://docs.godotengine.org/en/stable/)
|
||||
* [Install the Git Godot extension](https://docs.godotengine.org/en/stable/getting_started/workflow/project_setup/version_control_systems.html)
|
||||
* [Build and export the project](https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_projects.html#)
|
||||
* [Dialogic](https://dialogic.coppolaemilio.com/)
|
||||
* [EXP Godot Dialog System](https://github.com/EXPWorlds/Godot-Dialog-System)
|
||||
|
||||
## Technologies
|
||||
|
||||
This game is made with [Godot 3.2](https://godotengine.org), with the help of the [Dialogic](https://dialogic.coppolaemilio.com/) plugin by Emilio Coppola.
|
||||
This game is made with [Godot 3.2](https://godotengine.org), with the help of the [EXP Godot Dialog System](https://github.com/EXPWorlds/Godot-Dialog-System) by David Lipps.
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"color": "#ffc886c4",
|
||||
"color": "#ff147909",
|
||||
"default_speaker": false,
|
||||
"description": "L'écolo",
|
||||
"display_name": "",
|
||||
|
|
|
|||
|
|
@ -165,35 +165,10 @@
|
|||
"portrait": "",
|
||||
"text": "Excuse moi, mais je n’ai vraiment pas le temps. Je retourne travailler, à la prochaine."
|
||||
},
|
||||
{
|
||||
"character": "character-1616658373.json",
|
||||
"portrait": "evelyne_shocked",
|
||||
"text": "Et tu comptes vraiment laisser passer cette opportunité d'en apprendre plus sur un aspect aussi essentiel du développement des téléphones?"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658373.json",
|
||||
"portrait": "evelyne_blasee",
|
||||
"text": " Je ne sais pas si tu t'en rends compte mais d'un point de vue social, économique et même écologique, c'est une fonctionnalité essentielle!"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658373.json",
|
||||
"portrait": "evelyne_hautaine",
|
||||
"text": "Par exemple, si tu as un problème sur une certaine pièce, comme la batterie, tu peux simplement la changer au lieu d’en racheter un nouveau. "
|
||||
},
|
||||
{
|
||||
"character": "character-1616658373.json",
|
||||
"portrait": "evelyne_hautaine",
|
||||
"text": "Tu peux imaginer l’économie que tu fais non seulement pour ton porte-monnaie, mais aussi pour la planète. "
|
||||
},
|
||||
{
|
||||
"character": "character-1616658373.json",
|
||||
"portrait": "evelyne_sans_voix",
|
||||
"text": "Non honnêtement, je ne comprends pas ton manque d'ouverture d'esprit..."
|
||||
},
|
||||
{
|
||||
"character": "character-1616658373.json",
|
||||
"portrait": "evelyne_hautaine",
|
||||
"text": "Au moins tu le sauras pour la prochaine fois!"
|
||||
"text": "D’accord, bon courage."
|
||||
},
|
||||
{
|
||||
"endbranch": ""
|
||||
|
|
@ -206,7 +181,7 @@
|
|||
"character": "[All]"
|
||||
},
|
||||
{
|
||||
"wait_seconds": 1
|
||||
"wait_seconds": 0.5
|
||||
},
|
||||
{
|
||||
"action": "join",
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
{
|
||||
"character": "character-1616658403.json",
|
||||
"portrait": "Jean-Michel_haineux2",
|
||||
"text": "Et toutes les idées de design dont je t’avais parlées sont réduites à néant ! "
|
||||
"text": "Et toutes les idées de design dont je t’avais parlé sont réduites à néant ! "
|
||||
},
|
||||
{
|
||||
"character": "character-1616658403.json",
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
{
|
||||
"definition": "1618954308-648",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "1"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658471.json",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
{
|
||||
"character": "character-1618911589.json",
|
||||
"portrait": "",
|
||||
"text": "Ici, le but est simple.\nAfin de faire bonne impression pendant l’entretien et de bien répondre à la question, vous allez devoir récolter un maximum d’informations sur l’entreprise.\nLe mini-jeu s'arrêtera lorsque vous en aurez récolté 10 .\nAttention à ne pas vous laisser distraire par les spams (représentés par des enveloppes rouges).\nBonne chance !"
|
||||
"text": "Ici, le but est simple.\nAfin de faire bonne impression pendant l’entretien et de bien répondre à la question, vous allez devoir récolter un maximum d’informations sur l’entreprise.\nLe mini-jeu s'arrêtera lorsque vous en aurez récolté assez.\nAttention à ne pas vous laisser distraire par les spams (représentés par des enveloppes rouges).\nBonne chance !"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
{
|
||||
"character": "character-1616658355.json",
|
||||
"portrait": "",
|
||||
"text": "J’adore les nouvelles technologies et le secteur d’activité de l’entreprise correspond parfaitement à mes attentes.\nJe suis en accord avec les valeurs que vous transmettez, comme l’esprit d’équipe, d’engagement pour les clients et l’innovation.\nC’est pour ces raisons que j’aimerais beaucoup intégrer vos équipes."
|
||||
"text": "J’adore les nouvelles technologies et le secteur d’activité de l’entreprise correspond parfaitement à mes attentes.\nJe suis en accord avec les valeurs que vous transmettez, comme l’esprit d’équipe,ld’engagement pour les clients et l’innovation.\nC’est pour ces raisons que j’aimerais beaucoup intégrer vos équipes."
|
||||
},
|
||||
{
|
||||
"character": "character-1619380397.json",
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
{
|
||||
"character": "character-1616658435.json",
|
||||
"portrait": "Default",
|
||||
"text": "Au fait, j’ai reçu deux invitations à une conférence sur la vie privée des utilisateurs sur le web."
|
||||
"text": "Au fait, J’ai reçu deux invitations à une conférence sur la vie privée des utilisateurs sur le web."
|
||||
},
|
||||
{
|
||||
"character": "character-1616658435.json",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
{
|
||||
"events": [
|
||||
{
|
||||
"background": ""
|
||||
"background": "res://backgrounds/bureauGroupe-2.jpg"
|
||||
},
|
||||
{
|
||||
"emit_signal": "setup_minigame time 30 easy 1_2_minigame_lose 1_2_minigame_win 2"
|
||||
},
|
||||
{
|
||||
"background": ""
|
||||
},
|
||||
{
|
||||
"character": "character-1616658435.json",
|
||||
"portrait": "Default",
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
{
|
||||
"character": "character-1616658355.json",
|
||||
"portrait": "",
|
||||
"text": "C'est le moins qu'on puisse dire...\nMerci pour l'invitation !"
|
||||
"text": "C'est le moins qu'on puisse dire...\nMerci pour l'invtation !"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658435.json",
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
{
|
||||
"character": "character-1616658403.json",
|
||||
"portrait": "Jean-Michel_bien_joue_petit",
|
||||
"text": "Nous recevons régulièrement des offres de sponsors pour des moteurs de recherche. Parmi ces sponsors, on retrouve Gamazon, le célèbre site de vente en ligne."
|
||||
"text": "Nous recevons régulièrement des offres de sponsor pour des moteurs de recherche. Parmi ces sponsors, on retrouve Gamazon, le célèbre site de vente en ligne."
|
||||
},
|
||||
{
|
||||
"character": "character-1616658403.json",
|
||||
|
|
|
|||
|
|
@ -27,7 +27,10 @@
|
|||
{
|
||||
"character": "character-1618911589.json",
|
||||
"portrait": "",
|
||||
"text": "Tu as le choix entre trois moteurs de recherche :"
|
||||
"text": "Tu as le choix entre trois moteurs de recherche :\nQuant, Gooble ou Ecozio."
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
},
|
||||
{
|
||||
"character": "character-1618911589.json",
|
||||
|
|
@ -35,10 +38,7 @@
|
|||
|
||||
],
|
||||
"portrait": "",
|
||||
"question": "Quant, Gooble ou Ecozio. Lequel préfères-tu ?"
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
"question": "Lequel préfères-tu ?"
|
||||
},
|
||||
{
|
||||
"choice": "Quant",
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@
|
|||
{
|
||||
"character": "character-1619289879.json",
|
||||
"portrait": "Default",
|
||||
"text": "Regarde le mien !\nVitre en verre trempée à l’arrière, super fin et qui se glisse partout. "
|
||||
"text": "Regarde le mien !\nVitre en verre trempée à l’arrière, super fin et don se glisse partout. "
|
||||
},
|
||||
{
|
||||
"character": "character-1619289879.json",
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
{
|
||||
"character": "character-1618911589.json",
|
||||
"portrait": "",
|
||||
"text": "Ne sachant pas quoi faire, tu ramasses ce qu’il reste de ton smartphone et rentres chez toi."
|
||||
"text": "Ne sachant pas quoi faire, tu ramasses ce qu’il reste de ton smartphone et rentre chez toi."
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@
|
|||
{
|
||||
"character": "character-1616658355.json",
|
||||
"portrait": "",
|
||||
"text": "Je ne vois que trois solutions :"
|
||||
"text": "Je ne vois que trois solutions :\ncommander et changer l’écran, contacter un réparateur ou acheter un nouveau téléphone."
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658355.json",
|
||||
|
|
@ -22,10 +25,7 @@
|
|||
|
||||
],
|
||||
"portrait": "",
|
||||
"question": "Je peux commander et changer l’écran, contacter un réparateur ou acheter un nouveau téléphone. Que faire ?"
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
"question": "Que faire ?"
|
||||
},
|
||||
{
|
||||
"choice": "Commander et changer l’écran",
|
||||
|
|
@ -41,12 +41,12 @@
|
|||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "5"
|
||||
},
|
||||
{
|
||||
"definition": "1618954308-648",
|
||||
"operation": "+",
|
||||
"set_value": "5"
|
||||
"set_value": "4"
|
||||
},
|
||||
{
|
||||
"change_timeline": "timeline-1619292557.json"
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"change_timeline": "timeline-1619292618.json"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@
|
|||
{
|
||||
"character": "character-1616658355.json",
|
||||
"portrait": "",
|
||||
"text": "Je ne vois que quatre solutions :"
|
||||
"text": "Je ne vois que quatre solutions :\ncommander et changer l’écran, contacter un réparateur, acheter un téléphone neuf ou acheter un téléphone d'occasion."
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658355.json",
|
||||
|
|
@ -22,10 +25,7 @@
|
|||
|
||||
],
|
||||
"portrait": "",
|
||||
"question": "Je peux commander et changer l’écran, contacter un réparateur, acheter un téléphone neuf ou acheter un téléphone d'occasion. Que faire ?"
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
"question": "Que faire ?"
|
||||
},
|
||||
{
|
||||
"choice": "Commander et changer l’écran",
|
||||
|
|
@ -41,12 +41,12 @@
|
|||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "5"
|
||||
},
|
||||
{
|
||||
"definition": "1618954308-648",
|
||||
"operation": "+",
|
||||
"set_value": "5"
|
||||
"set_value": "4"
|
||||
},
|
||||
{
|
||||
"change_timeline": "timeline-1619294236.json"
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"change_timeline": "timeline-1619292618.json"
|
||||
|
|
@ -105,6 +105,11 @@
|
|||
"operation": "-",
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"change_timeline": "timeline-1619292798.json"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
|
|
|
|||
|
|
@ -64,6 +64,11 @@
|
|||
"definition": "",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"definition": "1618954333-366",
|
||||
"operation": "-",
|
||||
|
|
@ -98,7 +103,7 @@
|
|||
{
|
||||
"definition": "1618954344-146",
|
||||
"operation": "+",
|
||||
"set_value": "3"
|
||||
"set_value": "2"
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@
|
|||
{
|
||||
"character": "character-1616660196.json",
|
||||
"portrait": "",
|
||||
"text": "Adresse : 1 Rue Dauphine, Paris\nHoraires : Ouvert. Ferme à 19:00\nMlle Paris vous présente ses collections de bijoux fantaisie haut de gamme et ses accessoires de mode."
|
||||
"text": "Adresse : 1 Rue Dauphine, Paris\nHoraires : Ouvert ⋅ Ferme à 19:00\nMlle Paris vous présente ses collections de bijoux fantaisie haut de gamme et ses accessoires de mode."
|
||||
},
|
||||
{
|
||||
"character": "character-1616658355.json",
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@
|
|||
{
|
||||
"character": "character-1619300743.json",
|
||||
"portrait": "",
|
||||
"text": "Je veux bien s'il te plaît !"
|
||||
"text": "Je veux bien s'll te plaît !"
|
||||
},
|
||||
{
|
||||
"character": "character-1619294971.json",
|
||||
|
|
@ -197,7 +197,7 @@
|
|||
{
|
||||
"character": "character-1619300743.json",
|
||||
"portrait": "",
|
||||
"text": "Je veux bien s'il te plaît !"
|
||||
"text": "Je veux bien s'll te plaît !"
|
||||
},
|
||||
{
|
||||
"character": "character-1619294971.json",
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
"change_timeline": "timeline-1619345227.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non, je dois aller travailler...",
|
||||
"choice": "Non",
|
||||
"condition": "==",
|
||||
"definition": "1619344733-648",
|
||||
"value": "2"
|
||||
|
|
@ -229,11 +229,6 @@
|
|||
"action": "leaveall",
|
||||
"character": "[All]"
|
||||
},
|
||||
{
|
||||
"character": "character-1616658355.json",
|
||||
"portrait": "",
|
||||
"text": "Non pas ce soir les gens, l'exam de demain me stresse beaucoup trop... Je peux pas me permettre de jouer, faut que j'aille finir de réviser et dormir pour être en forme demain!"
|
||||
},
|
||||
{
|
||||
"definition": "1618954357-918",
|
||||
"operation": "-",
|
||||
|
|
@ -291,7 +286,86 @@
|
|||
{
|
||||
"character": "character-1618911589.json",
|
||||
"portrait": "",
|
||||
"text": "Après avoir relu ton cours une dernière fois, tu as bien dormi et ton téléphone ne t'a pas ditrait …\nTon partiel du lendemain s’est bien passé."
|
||||
"text": "Tu as bien dormi et ton téléphone ne t'a pas ditrait …\nTon partiel du lendemain s’est bien passé."
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
"character": "[All]"
|
||||
},
|
||||
{
|
||||
"wait_seconds": 1
|
||||
},
|
||||
{
|
||||
"change_timeline": "timeline-1619346229.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non",
|
||||
"condition": "==",
|
||||
"definition": "1619344733-648",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
"character": "[All]"
|
||||
},
|
||||
{
|
||||
"definition": "1618954357-918",
|
||||
"operation": "-",
|
||||
"set_value": "4"
|
||||
},
|
||||
{
|
||||
"definition": "1619469908-574",
|
||||
"operation": "=",
|
||||
"set_value": "3"
|
||||
},
|
||||
{
|
||||
"wait_seconds": 1
|
||||
},
|
||||
{
|
||||
"action": "join",
|
||||
"character": "character-1619294971.json",
|
||||
"mirror": false,
|
||||
"portrait": "Default",
|
||||
"position": {
|
||||
"0": false,
|
||||
"1": false,
|
||||
"2": true,
|
||||
"3": false,
|
||||
"4": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"character": "character-1619294971.json",
|
||||
"portrait": "",
|
||||
"text": "Dommage, un autre soir alors, on n'est pas assez pour jouer."
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
"character": "[All]"
|
||||
},
|
||||
{
|
||||
"wait_seconds": 1
|
||||
},
|
||||
{
|
||||
"background": "res://backgrounds/noir.jpg"
|
||||
},
|
||||
{
|
||||
"action": "join",
|
||||
"character": "character-1618911589.json",
|
||||
"mirror": false,
|
||||
"portrait": "Default",
|
||||
"position": {
|
||||
"0": true,
|
||||
"1": false,
|
||||
"2": false,
|
||||
"3": false,
|
||||
"4": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"character": "character-1618911589.json",
|
||||
"portrait": "",
|
||||
"text": "Tu as bien dormi et ton téléphone ne t'a pas ditrait …\nTon partiel du lendemain s’est bien passé."
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
|
|
@ -317,7 +391,7 @@
|
|||
{
|
||||
"character": "character-1619300743.json",
|
||||
"portrait": "",
|
||||
"text": "Je veux bien s'il te plaît !"
|
||||
"text": "Je veux bien s'll te plaît !"
|
||||
},
|
||||
{
|
||||
"character": "character-1619294971.json",
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
{
|
||||
"character": "character-1619294971.json",
|
||||
"portrait": "",
|
||||
"text": "Pour gagner la partie, évite les mauvais dessins et fais ressortir le Léonard de Vinci qui sommeille en toi !\nRécupère 20 tableaux pour gagner la partie!\nBonne chance !"
|
||||
"text": "Pour gagner la partie, évite les mauvais dessins et fais ressortir le Léonard de Vinci qui sommeille en toi !\nBonne chance !"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
|
|
|
|||
|
|
@ -142,9 +142,9 @@
|
|||
},
|
||||
{
|
||||
"choice": "Aller dormir",
|
||||
"condition": "<",
|
||||
"definition": "1619357721-648",
|
||||
"value": "3"
|
||||
"condition": "",
|
||||
"definition": "",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"character": "character-1619368458.json",
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
{
|
||||
"character": "character-1618911589.json",
|
||||
"portrait": "",
|
||||
"text": "En plus des différents choix que vous devrez faire tout au long du jeu, vous ferez également face à des dilemmes demandant plus de réflexion.\nN’oubliez pas que les mots de couleur verte permettent d’obtenir des informations supplémentaires lorsque vous passez la souris dessus. \nPar la suite, vous aurez également l’occasion de discuter avec des collègues, par exemple, pour vous renseigner concernant ces dilemmes."
|
||||
"text": "En plus des différents choix que vous devrez faire tout au long du jeu, vous ferez également face à des dilemmes demandant plus de réflexion.\nN’oubliez pas que les mots de couleur vert permettent d’obtenir des informations supplémentaires lorsque vous passez la souris dessus. \nPar la suite, vous aurez également l’occasion de discuter avec des collègues,par exemple, pour vous renseigner concernant ces dilemmes."
|
||||
},
|
||||
{
|
||||
"action": "leaveall",
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
{
|
||||
"character": "character-1619380397.json",
|
||||
"portrait": "",
|
||||
"text": "Préféreriez-vous prévenir l’entreprise ? Ou, alors, vous préférez rendre la faille publique ? "
|
||||
"text": "Préféreriez-vous prévenir l’entreprise ? \nOu, alors, vous préférez rendre la faille publique ? "
|
||||
},
|
||||
{
|
||||
"set_theme": "theme-1616657657.cfg"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
{
|
||||
"character": "character-1619294971.json",
|
||||
"portrait": "",
|
||||
"text": "N'oublie pas, pour gagner la partie, évite les mauvais dessins et fais ressortir le Léonard de Vinci qui sommeille en toi !\nRécupère 20 tableaux pour gagner la partie!\nBonne chance !"
|
||||
"text": "N'oublie pas, pour gagner la partie, évite les mauvais dessins et fais ressortir le Léonard de Vinci qui sommeille en toi !\nBonne chance !"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
|
|
|
|||
|
|
@ -31,14 +31,7 @@
|
|||
"value": ""
|
||||
},
|
||||
{
|
||||
"emit_signal": "setup_minigame time 30 easy 1_2_minigame_lose 1_2_minigame_win 2"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
},
|
||||
{
|
||||
"close_dialog": "",
|
||||
"transition_duration": 0
|
||||
"change_timeline": "timeline-1619205796.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non",
|
||||
|
|
|
|||
|
|
@ -36,14 +36,7 @@
|
|||
"value": ""
|
||||
},
|
||||
{
|
||||
"emit_signal": "setup_minigame score 10 easy 0_0_minigame_lose 0_0_minigame_win 1"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
},
|
||||
{
|
||||
"close_dialog": "",
|
||||
"transition_duration": 0
|
||||
"change_timeline": "timeline-1619185676.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non",
|
||||
|
|
|
|||
|
|
@ -43,19 +43,7 @@
|
|||
"wait_seconds": 1
|
||||
},
|
||||
{
|
||||
"definition": "1619357721-648",
|
||||
"operation": "+",
|
||||
"set_value": "1"
|
||||
},
|
||||
{
|
||||
"emit_signal": "setup_minigame score 20 easy 2_2_1_minigame_lose 2_2_1_minigame_win 4"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
},
|
||||
{
|
||||
"close_dialog": "",
|
||||
"transition_duration": 0
|
||||
"change_timeline": "timeline-1619345227.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non, je ne suis pas Picasso",
|
||||
|
|
|
|||
|
|
@ -43,19 +43,7 @@
|
|||
"wait_seconds": 1
|
||||
},
|
||||
{
|
||||
"definition": "1619357721-648",
|
||||
"operation": "+",
|
||||
"set_value": "1"
|
||||
},
|
||||
{
|
||||
"emit_signal": "setup_minigame score 20 easy 2_2_1_minigame_lose 2_2_1_minigame_win 4"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
},
|
||||
{
|
||||
"close_dialog": "",
|
||||
"transition_duration": 0
|
||||
"change_timeline": "timeline-1619426738.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non, je ne suis malheureusement pas Picasso",
|
||||
|
|
|
|||
|
|
@ -43,19 +43,7 @@
|
|||
"wait_seconds": 1
|
||||
},
|
||||
{
|
||||
"definition": "1619357721-648",
|
||||
"operation": "=",
|
||||
"set_value": "1"
|
||||
},
|
||||
{
|
||||
"emit_signal": "setup_minigame score 20 easy 2_2_1_minigame_lose 2_2_1_minigame_win 4"
|
||||
},
|
||||
{
|
||||
"emit_signal": "start_minigame"
|
||||
},
|
||||
{
|
||||
"close_dialog": "",
|
||||
"transition_duration": 0
|
||||
"change_timeline": "timeline-1619426853.json"
|
||||
},
|
||||
{
|
||||
"choice": "Non, je ne suis malheureusement pas Picasso",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
{
|
||||
"character": "character-1616658355.json",
|
||||
"portrait": "",
|
||||
"text": "J’avoue être assez timide dans la vie de tous les jours et rougir facilement. \nToutefois, je n’hésite pas à donner mon avis, si je pense que c’est nécessaire."
|
||||
"text": "J’avoue que l’écologie n’est pas une de mes priorités dans la vie. \nMais j’essaie de m’améliorer sur ce point."
|
||||
},
|
||||
{
|
||||
"choice": "Je ne recycle que le verre",
|
||||
|
|
|
|||
|
|
@ -3,49 +3,38 @@ extends Node
|
|||
signal game_over
|
||||
|
||||
onready var foreground := $foreground
|
||||
onready var background := $background
|
||||
onready var spawner := $spawner
|
||||
onready var player := $player
|
||||
onready var player := $player2
|
||||
onready var scoreUI := $scoreUI
|
||||
onready var start_timer_UI := $startTimerUI
|
||||
onready var start_timer_UI := $start_timer_UI
|
||||
onready var instructionsUI := $instructionsUI
|
||||
onready var score_timer := $ScoreTimer
|
||||
onready var speed_timer := $SpeedTimer
|
||||
|
||||
var next_timeline_lose := ""
|
||||
var next_timeline_win := ""
|
||||
|
||||
var game_mode = ""
|
||||
var game_goal = 10
|
||||
var current_goal = 0
|
||||
var game_difficulty = "easy"
|
||||
var game_version = 0
|
||||
|
||||
var MUSIC = "res://music/mini_jeu.ogg"
|
||||
|
||||
var game_speed = 0 setget set_game_speed
|
||||
|
||||
export var speed_increments := 0.1
|
||||
export var max_speed := 8
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
Signals.connect("die", self, "on_game_over")
|
||||
Signals.connect("win", self, "on_win")
|
||||
|
||||
|
||||
func setup(mode: String, goal: int, difficulty: String, next_lose: String, next_win: String, version: int):
|
||||
game_goal = goal
|
||||
current_goal = 0
|
||||
if(difficulty == "hard"):
|
||||
game_difficulty = "hard"
|
||||
else:
|
||||
game_difficulty = "easy"
|
||||
game_version = version
|
||||
print("setup minigame: " + mode + " " + next_lose + " " + next_win + " | version: " + String(version))
|
||||
print("minigame: " + mode + " " + next_lose + " " + next_win)
|
||||
set_mode(mode)
|
||||
background.init(game_version)
|
||||
foreground.init(game_speed, game_version)
|
||||
spawner.init(game_difficulty, game_version)
|
||||
scoreUI.init(mode, goal)
|
||||
scoreUI.init(mode, game_goal)
|
||||
next_timeline_lose = next_lose
|
||||
next_timeline_win = next_win
|
||||
|
||||
|
|
@ -65,79 +54,34 @@ func start():
|
|||
BackgroundMusic.crossfade_to(MUSIC, -10, 1)
|
||||
start_timer_UI.init()
|
||||
var t = Timer.new()
|
||||
t.wait_time = 0.5
|
||||
t.autostart = true
|
||||
t.set_wait_time(0.5)
|
||||
add_child(t)
|
||||
t.start()
|
||||
for n in range(3,0,-1):
|
||||
start_timer_UI.update_timer(n)
|
||||
start_timer_UI.update_timer(String(n))
|
||||
yield(t, "timeout")
|
||||
start_timer_UI.update_timer(0)
|
||||
instructionsUI.start()
|
||||
start_timer_UI.update_timer("GO !")
|
||||
instructionsUI._init()
|
||||
foreground.start()
|
||||
player.start()
|
||||
player.start(game_mode, game_goal)
|
||||
yield(t, "timeout")
|
||||
yield(t, "timeout")
|
||||
start_timer_UI.hide()
|
||||
spawner.start()
|
||||
if game_mode == "score":
|
||||
scoreUI.start(0)
|
||||
else:
|
||||
scoreUI.start(game_goal)
|
||||
spawner.start(game_difficulty, game_version)
|
||||
scoreUI.start(game_mode)
|
||||
t.queue_free()
|
||||
if game_mode == "time":
|
||||
score_timer.start()
|
||||
speed_timer.start()
|
||||
|
||||
|
||||
func stop():
|
||||
foreground.stop()
|
||||
instructionsUI.stop()
|
||||
player.stop()
|
||||
spawner.stop()
|
||||
score_timer.stop()
|
||||
speed_timer.stop()
|
||||
|
||||
|
||||
|
||||
func on_win():
|
||||
stop()
|
||||
emit_signal("game_over", next_timeline_win)
|
||||
|
||||
|
||||
func on_game_over():
|
||||
stop()
|
||||
emit_signal("game_over", next_timeline_lose)
|
||||
|
||||
|
||||
func _on_player_die() -> void:
|
||||
on_game_over()
|
||||
|
||||
|
||||
func _on_player_hit() -> void:
|
||||
pass
|
||||
|
||||
|
||||
func update_score():
|
||||
current_goal += 1
|
||||
scoreUI.update_score(current_goal)
|
||||
if current_goal >= game_goal:
|
||||
on_win()
|
||||
|
||||
|
||||
func set_game_speed(new_value: float):
|
||||
game_speed = new_value
|
||||
if game_speed > max_speed:
|
||||
game_speed = max_speed
|
||||
foreground.speed_offset = game_speed
|
||||
spawner.speed_offset = game_speed
|
||||
|
||||
|
||||
func _on_player_score() -> void:
|
||||
update_score()
|
||||
|
||||
|
||||
func _on_ScoreTimer_timeout() -> void:
|
||||
update_score()
|
||||
|
||||
|
||||
func _on_SpeedTimer_timeout() -> void:
|
||||
set_game_speed(game_speed + speed_increments)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
[ext_resource path="res://mini-game/scenes/decor/background.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/decor/foreground.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/players/player.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://mini-game/scenes/players/player2.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://mini-game/MiniGame.gd" type="Script" id=4]
|
||||
[ext_resource path="res://mini-game/scenes/decor/startTimerUI.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://mini-game/scenes/decor/start_timer_UI.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://mini-game/scenes/spawner/spawner.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://mini-game/scenes/decor/scoreUI.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://mini-game/scenes/decor/instructionsUI.tscn" type="PackedScene" id=8]
|
||||
|
|
@ -19,21 +19,13 @@ script = ExtResource( 4 )
|
|||
[node name="spawner" parent="." instance=ExtResource( 6 )]
|
||||
position = Vector2( 2015.43, 970.395 )
|
||||
|
||||
[node name="player" parent="." instance=ExtResource( 3 )]
|
||||
[node name="player2" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 183.674, 888.367 )
|
||||
jump_vitesse = 1100.0
|
||||
gravite = 45.0
|
||||
|
||||
[node name="scoreUI" parent="." instance=ExtResource( 7 )]
|
||||
|
||||
[node name="startTimerUI" parent="." instance=ExtResource( 5 )]
|
||||
[node name="start_timer_UI" parent="." instance=ExtResource( 5 )]
|
||||
|
||||
[node name="instructionsUI" parent="." instance=ExtResource( 8 )]
|
||||
|
||||
[node name="ScoreTimer" type="Timer" parent="."]
|
||||
|
||||
[node name="SpeedTimer" type="Timer" parent="."]
|
||||
|
||||
[connection signal="die" from="player" to="." method="_on_player_die"]
|
||||
[connection signal="hit" from="player" to="." method="_on_player_hit"]
|
||||
[connection signal="score" from="player" to="." method="_on_player_score"]
|
||||
[connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"]
|
||||
[connection signal="timeout" from="SpeedTimer" to="." method="_on_SpeedTimer_timeout"]
|
||||
|
|
|
|||
BIN
mini-game/ressources/backgrounds/background.png
Normal file
|
After Width: | Height: | Size: 226 KiB |
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bg2.png-ed986a1e6aeff7730721b86542dccb83.stex"
|
||||
path="res://.import/background.png-505e23e85d466d6becabf2def4a53663.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/bg2.png"
|
||||
dest_files=[ "res://.import/bg2.png-ed986a1e6aeff7730721b86542dccb83.stex" ]
|
||||
source_file="res://mini-game/ressources/backgrounds/background.png"
|
||||
dest_files=[ "res://.import/background.png-505e23e85d466d6becabf2def4a53663.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 262 KiB |
|
Before Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bg5.png-2cd6ea5f2184bb027b7b24e45141bb4e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/bg5.png"
|
||||
dest_files=[ "res://.import/bg5.png-2cd6ea5f2184bb027b7b24e45141bb4e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 57 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bg6.png-e7c1c3681ff5618e64b93ab189acb346.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/bg6.png"
|
||||
dest_files=[ "res://.import/bg6.png-e7c1c3681ff5618e64b93ab189acb346.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fg1.png-1223bd947bc074f762b942936a2c3080.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/fg1.png"
|
||||
dest_files=[ "res://.import/fg1.png-1223bd947bc074f762b942936a2c3080.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 21 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fg2.png-3c5c1093a1643c1ef511181761a72e0c.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/fg2.png"
|
||||
dest_files=[ "res://.import/fg2.png-3c5c1093a1643c1ef511181761a72e0c.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 70 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fg3.png-ace556d90c80e77c61204459f3601219.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/fg3.png"
|
||||
dest_files=[ "res://.import/fg3.png-ace556d90c80e77c61204459f3601219.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fg4.png-2d72d37b23620ce49094263e1cd72ade.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/fg4.png"
|
||||
dest_files=[ "res://.import/fg4.png-2d72d37b23620ce49094263e1cd72ade.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fg5.png-c061aecd9606bd3aa6f8c79d2f3080f1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/fg5.png"
|
||||
dest_files=[ "res://.import/fg5.png-c061aecd9606bd3aa6f8c79d2f3080f1.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 21 KiB |
|
|
@ -1,34 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/fg6.png-5d1e4f373d56fd25324325e27a4d63ab.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/fg6.png"
|
||||
dest_files=[ "res://.import/fg6.png-5d1e4f373d56fd25324325e27a4d63ab.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
BIN
mini-game/ressources/backgrounds/ground.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bg4.png-aa6a9a6fa47fc463e4971b9c2630ff93.stex"
|
||||
path="res://.import/ground.png-4932cc62bec22f379d126a8ed00b8065.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/bg4.png"
|
||||
dest_files=[ "res://.import/bg4.png-aa6a9a6fa47fc463e4971b9c2630ff93.stex" ]
|
||||
source_file="res://mini-game/ressources/backgrounds/ground.png"
|
||||
dest_files=[ "res://.import/ground.png-4932cc62bec22f379d126a8ed00b8065.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
BIN
mini-game/ressources/backgrounds/road.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bg3.png-85672fb13dbe4d129faf660cb55f24ec.stex"
|
||||
path="res://.import/road.png-a47382164ab08d2b16ee5556b011c7ae.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/bg3.png"
|
||||
dest_files=[ "res://.import/bg3.png-85672fb13dbe4d129faf660cb55f24ec.stex" ]
|
||||
source_file="res://mini-game/ressources/backgrounds/road.png"
|
||||
dest_files=[ "res://.import/road.png-a47382164ab08d2b16ee5556b011c7ae.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
BIN
mini-game/ressources/backgrounds/road2.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/plus1.png-cc79269c0c50fcad6d2e64ff1f8fd09b.stex"
|
||||
path="res://.import/road2.png-e0bf36dfcd897889f0653f61c752133d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/plus1.png"
|
||||
dest_files=[ "res://.import/plus1.png-cc79269c0c50fcad6d2e64ff1f8fd09b.stex" ]
|
||||
source_file="res://mini-game/ressources/backgrounds/road2.png"
|
||||
dest_files=[ "res://.import/road2.png-e0bf36dfcd897889f0653f61c752133d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bg1.png-8ae713bba3ad2ecc3258923cae812490.stex"
|
||||
path="res://.import/road3.png-648b2e9aa7ca850c48819c6380f474a0.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/backgrounds/bg1.png"
|
||||
dest_files=[ "res://.import/bg1.png-8ae713bba3ad2ecc3258923cae812490.stex" ]
|
||||
source_file="res://mini-game/ressources/backgrounds/road3.png"
|
||||
dest_files=[ "res://.import/road3.png-648b2e9aa7ca850c48819c6380f474a0.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
kenney interface sounds
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/drop_004.wav-885be4baf10db32694bc6a0533126d41.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sounds/drop_004.wav"
|
||||
dest_files=[ "res://.import/drop_004.wav-885be4baf10db32694bc6a0533126d41.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/error_006.wav-438e664d4aa9fd9a3094b65b6b14697e.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sounds/error_006.wav"
|
||||
dest_files=[ "res://.import/error_006.wav-438e664d4aa9fd9a3094b65b6b14697e.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/select_006.wav-751a8b3f8c877e8e8de092e911ac7aaf.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sounds/select_006.wav"
|
||||
dest_files=[ "res://.import/select_006.wav-751a8b3f8c877e8e8de092e911ac7aaf.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
|
|
@ -1,8 +1,24 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/bonus/bone.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="bonus1" instance=ExtResource( 1 )]
|
||||
sprite_texture = ExtResource( 2 )
|
||||
type = "bonus"
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 24.0183, 9.31512 )
|
||||
|
||||
[node name="bonus1" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.119644, 0.119644 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
|
||||
[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,24 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/bonus/bonus_enveloppe.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="bonus1" instance=ExtResource( 1 )]
|
||||
sprite_texture = ExtResource( 2 )
|
||||
type = "bonus"
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 51.3758, 37.234 )
|
||||
|
||||
[node name="bonus2" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
|
||||
position = Vector2( -0.625, 0 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,25 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/bonus/oreille.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="bonus3" instance=ExtResource( 1 )]
|
||||
scale = Vector2( 0.4, 0.4 )
|
||||
sprite_texture = ExtResource( 2 )
|
||||
type = "bonus"
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 44.6127, 47.0458 )
|
||||
|
||||
[node name="notifier" parent="." index="2"]
|
||||
position = Vector2( 0.721308, 0.83428 )
|
||||
scale = Vector2( 2.79369, 3.54454 )
|
||||
[node name="bonus3" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 0.627587, -14.6332 )
|
||||
scale = Vector2( 0.101666, 0.101666 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
|
||||
position = Vector2( 1.00113, -11.3461 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,25 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/bonus/telephonebrillant.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="bonus4" instance=ExtResource( 1 )]
|
||||
scale = Vector2( 0.4, 0.4 )
|
||||
sprite_texture = ExtResource( 2 )
|
||||
type = "bonus"
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 25.9386, 54.0271 )
|
||||
|
||||
[node name="notifier" parent="." index="2"]
|
||||
position = Vector2( 0.29805, 0.353561 )
|
||||
[node name="bonus4" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( -0.453356, -18.8551 )
|
||||
scale = Vector2( 0.0729584, 0.0729585 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
|
||||
position = Vector2( -0.594162, -14.2551 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,28 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/bonus/peinture.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="bonus5" instance=ExtResource( 1 )]
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
sprite_texture = ExtResource( 2 )
|
||||
type = "bonus"
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 30.5774, 94.4143 )
|
||||
|
||||
[node name="notifier" parent="." index="2"]
|
||||
position = Vector2( 0.353607, 0 )
|
||||
[node name="bonus5" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_horizontal_guides_": [ -97.9765 ]
|
||||
}
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 0.0226159, -21.252 )
|
||||
scale = Vector2( 0.101622, 0.101622 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
|
||||
position = Vector2( -0.759476, -7.68111 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
extends Sprite
|
||||
|
||||
export var scroll_speed = 9
|
||||
|
||||
export(Array, Texture) var textures := []
|
||||
|
||||
var speed_offset : float = 0
|
||||
var moving = false
|
||||
var game_version := 0 setget set_game_version
|
||||
|
||||
signal viewport_entered(object)
|
||||
signal viewport_exited(object)
|
||||
|
||||
|
||||
func start():
|
||||
moving = true
|
||||
|
||||
|
||||
func stop():
|
||||
moving = false
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if moving:
|
||||
move()
|
||||
|
||||
|
||||
func move():
|
||||
position.x -= scroll_speed + speed_offset
|
||||
|
||||
|
||||
func set_game_version(new_value: int):
|
||||
game_version = new_value
|
||||
if game_version < textures.size():
|
||||
texture = textures[game_version]
|
||||
else:
|
||||
texture = textures[0]
|
||||
|
||||
|
||||
func _on_VisibilityNotifier2D_viewport_entered(viewport: Viewport) -> void:
|
||||
emit_signal("viewport_entered", self)
|
||||
|
||||
|
||||
func _on_VisibilityNotifier2D_viewport_exited(viewport: Viewport) -> void:
|
||||
emit_signal("viewport_exited", self)
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/decor/ForegroundSprite.gd" type="Script" id=2]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/fg6.png" type="Texture" id=3]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/fg2.png" type="Texture" id=5]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/fg1.png" type="Texture" id=6]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/fg3.png" type="Texture" id=7]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/fg5.png" type="Texture" id=8]
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform float scroll_speed;
|
||||
|
||||
void fragment(){
|
||||
vec2 u = UV;
|
||||
u.x += scroll_speed*TIME;
|
||||
vec4 color = texture(TEXTURE,u);
|
||||
COLOR = color;
|
||||
}
|
||||
"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/scroll_speed = 0.0
|
||||
|
||||
[sub_resource type="StreamTexture" id=3]
|
||||
flags = 4
|
||||
load_path = "res://.import/road3.png-648b2e9aa7ca850c48819c6380f474a0.stex"
|
||||
|
||||
[node name="ForegroundSprite" type="Sprite"]
|
||||
material = SubResource( 2 )
|
||||
texture = SubResource( 3 )
|
||||
offset = Vector2( 960, 540 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
textures = [ ExtResource( 6 ), ExtResource( 5 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 3 ) ]
|
||||
|
||||
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
|
||||
position = Vector2( 1930, 540 )
|
||||
|
||||
[connection signal="viewport_entered" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_viewport_entered"]
|
||||
[connection signal="viewport_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_viewport_exited"]
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
extends Control
|
||||
|
||||
export(Array, Texture) var textures := []
|
||||
|
||||
var game_version := 0
|
||||
|
||||
func init(version: int):
|
||||
game_version = version
|
||||
if version < textures.size():
|
||||
$TextureRect.texture = textures[version]
|
||||
else:
|
||||
$TextureRect.texture = textures[0]
|
||||
|
|
@ -1,22 +1,13 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/city.png" type="Texture" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/decor/background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/bg1.png" type="Texture" id=3]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/bg3.png" type="Texture" id=4]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/bg5.png" type="Texture" id=5]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/bg6.png" type="Texture" id=6]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/bg2.png" type="Texture" id=7]
|
||||
|
||||
[node name="background" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
textures = [ ExtResource( 3 ), ExtResource( 7 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ) ]
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
anchor_right = 1.0
|
||||
|
|
|
|||
|
|
@ -1,56 +1,27 @@
|
|||
extends Node2D
|
||||
|
||||
var sprite_scene = preload("res://mini-game/scenes/decor/ForegroundSprite.tscn")
|
||||
onready var texture : TextureRect = $TextureRect
|
||||
|
||||
var sprites := []
|
||||
var game_version := 0
|
||||
var moving := false
|
||||
|
||||
var speed_offset : float = 0 setget set_speed_offset
|
||||
var force_stop = false
|
||||
var moving = false
|
||||
|
||||
func _ready():
|
||||
sprites.append($ForegroundSprite)
|
||||
stop()
|
||||
|
||||
|
||||
func init(speed: float, version: int):
|
||||
game_version = version
|
||||
for s in sprites:
|
||||
s.game_version = game_version
|
||||
set_speed_offset(speed)
|
||||
|
||||
|
||||
func set_speed_offset(new_value: float):
|
||||
speed_offset = new_value
|
||||
for t in sprites:
|
||||
t.speed_offset = speed_offset
|
||||
|
||||
|
||||
func stop():
|
||||
moving = false
|
||||
for t in sprites:
|
||||
t.stop()
|
||||
|
||||
force_stop = true
|
||||
texture.material.set_shader_param("scroll_speed", 0)
|
||||
|
||||
func start():
|
||||
moving = true
|
||||
for t in sprites:
|
||||
t.start()
|
||||
force_stop = false
|
||||
texture.material.set_shader_param("scroll_speed", 0.2)
|
||||
|
||||
|
||||
func _on_ForegroundSprite_viewport_entered(object: Sprite) -> void:
|
||||
var new_sprite = sprite_scene.instance()
|
||||
new_sprite.position = Vector2(1920, 0)
|
||||
new_sprite.speed_offset = speed_offset
|
||||
new_sprite.connect("viewport_entered", self, "_on_ForegroundSprite_viewport_entered")
|
||||
new_sprite.connect("viewport_exited", self, "_on_ForegroundSprite_viewport_exited")
|
||||
if moving:
|
||||
new_sprite.start()
|
||||
new_sprite.game_version = game_version
|
||||
add_child(new_sprite)
|
||||
sprites.append(new_sprite)
|
||||
|
||||
|
||||
func _on_ForegroundSprite_viewport_exited(object: Sprite) -> void:
|
||||
sprites.remove(sprites.find(object))
|
||||
object.queue_free()
|
||||
func _process(delta):
|
||||
if not force_stop:
|
||||
if get_tree().paused and moving:
|
||||
stop()
|
||||
force_stop = false
|
||||
elif not get_tree().paused and not moving:
|
||||
start()
|
||||
|
|
|
|||
|
|
@ -1,21 +1,45 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/decor/foreground.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/decor/ForegroundSprite.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://mini-game/ressources/backgrounds/road3.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform float scroll_speed;
|
||||
|
||||
void fragment(){
|
||||
vec2 u = UV;
|
||||
u.x += scroll_speed*TIME;
|
||||
vec4 color = texture(TEXTURE,u);
|
||||
COLOR = color;
|
||||
}
|
||||
"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/scroll_speed = 0.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 958.398, 78.6175 )
|
||||
|
||||
[node name="foreground" type="Node2D"]
|
||||
pause_mode = 2
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
material = SubResource( 2 )
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 1080.0
|
||||
texture = ExtResource( 2 )
|
||||
stretch_mode = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2( 960, 1080 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="ForegroundSprite" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[connection signal="viewport_entered" from="ForegroundSprite" to="." method="_on_ForegroundSprite_viewport_entered"]
|
||||
[connection signal="viewport_exited" from="ForegroundSprite" to="." method="_on_ForegroundSprite_viewport_exited"]
|
||||
shape = SubResource( 3 )
|
||||
|
|
|
|||
|
|
@ -1,38 +1,32 @@
|
|||
extends Control
|
||||
|
||||
onready var timer := $Timer
|
||||
|
||||
var jump_key = "dialogic_next"
|
||||
|
||||
var waiting = false
|
||||
var jumped = false
|
||||
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed(jump_key) and waiting:
|
||||
waiting = false
|
||||
|
||||
|
||||
func _ready():
|
||||
hide()
|
||||
|
||||
|
||||
func stop():
|
||||
waiting = false
|
||||
timer.stop()
|
||||
hide()
|
||||
|
||||
|
||||
func start():
|
||||
waiting = true
|
||||
timer.start()
|
||||
show()
|
||||
|
||||
|
||||
func _on_Timer_timeout() -> void:
|
||||
if waiting:
|
||||
func _wait_for_jump():
|
||||
var t = Timer.new()
|
||||
t.set_wait_time(0.5)
|
||||
add_child(t)
|
||||
t.start()
|
||||
while(!jumped):
|
||||
yield(t, "timeout")
|
||||
if visible:
|
||||
hide()
|
||||
else:
|
||||
show()
|
||||
else:
|
||||
stop()
|
||||
yield(t, "timeout")
|
||||
hide()
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed(jump_key):
|
||||
jumped = true
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
hide()
|
||||
|
||||
|
||||
func _init():
|
||||
show()
|
||||
_wait_for_jump()
|
||||
|
|
|
|||
|
|
@ -36,8 +36,3 @@ margin_bottom = 207.0
|
|||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Appuyer sur ESPACE pour sauter"
|
||||
align = 1
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 0.5
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
||||
|
|
|
|||
|
|
@ -1,28 +1,46 @@
|
|||
extends Control
|
||||
|
||||
onready var objective_label := $MarginContainer/VBoxContainer/ObjectiveLabel
|
||||
onready var score_label := $MarginContainer/VBoxContainer/ScoreLabel
|
||||
onready var label : Label = $MarginContainer/Label
|
||||
|
||||
var game_mode
|
||||
var max_time = 30
|
||||
|
||||
var game_objective : int
|
||||
func _ready():
|
||||
Signals.connect("update_score",self,"update_score")
|
||||
|
||||
|
||||
|
||||
func update_score(score: int):
|
||||
score_label.text = String(score) + "/" + String(game_objective)
|
||||
label.text = String(score)
|
||||
|
||||
func start(mode: String):
|
||||
|
||||
match mode:
|
||||
"score":
|
||||
update_score(0)
|
||||
show()
|
||||
"time":
|
||||
update_score(max_time)
|
||||
show()
|
||||
var t = Timer.new()
|
||||
t.set_wait_time(1)
|
||||
add_child(t)
|
||||
t.start()
|
||||
for n in range(max_time,0,-1):
|
||||
update_score(n)
|
||||
yield(t,"timeout")
|
||||
update_score(0)
|
||||
Signals.emit_signal("win")
|
||||
_:
|
||||
print("game_mode not recognized by scoreUI")
|
||||
|
||||
|
||||
func start(initial_score: int):
|
||||
update_score(initial_score)
|
||||
show()
|
||||
func set_max_time(time: int):
|
||||
max_time = time
|
||||
|
||||
|
||||
func init(mode: String, objective: int):
|
||||
game_objective = objective
|
||||
func init(mode, goal: int):
|
||||
game_mode = mode
|
||||
if game_mode == "score":
|
||||
objective_label.text = "Obtenez le score indiqué"
|
||||
elif game_mode == "time":
|
||||
objective_label.text = "Survivez le temps indiqué"
|
||||
else:
|
||||
objective_label.text = "Erreur"
|
||||
if (goal != 0):
|
||||
max_time = goal
|
||||
hide()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/ressources/font/joystix/ot/joystix monospace.otf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/decor/scoreUI.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 70
|
||||
outline_size = 2
|
||||
outline_color = Color( 0, 0, 0, 1 )
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 50
|
||||
outline_size = 2
|
||||
|
|
@ -34,26 +28,11 @@ __meta__ = {
|
|||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
[node name="Label" type="Label" parent="MarginContainer"]
|
||||
margin_left = 10.0
|
||||
margin_top = 10.0
|
||||
margin_right = 1910.0
|
||||
margin_bottom = 160.0
|
||||
|
||||
[node name="ObjectiveLabel" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
margin_right = 1900.0
|
||||
margin_bottom = 85.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Objective"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = 89.0
|
||||
margin_right = 1900.0
|
||||
margin_bottom = 150.0
|
||||
margin_bottom = 71.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "99999"
|
||||
align = 1
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
extends Control
|
||||
|
||||
|
||||
onready var label : Label = $MarginContainer/Label
|
||||
|
||||
func _ready():
|
||||
hide()
|
||||
|
||||
|
||||
func update_timer(score: int):
|
||||
if score > 0:
|
||||
label.text = String(score)
|
||||
else:
|
||||
label.text = "GO !"
|
||||
|
||||
|
||||
func init():
|
||||
update_timer(3)
|
||||
show()
|
||||
|
||||
18
mini-game/scenes/decor/start_timer_UI.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
extends Control
|
||||
|
||||
|
||||
onready var label : Label = $MarginContainer/Label
|
||||
|
||||
func _ready():
|
||||
Signals.connect("update_timer",self,"update_timer")
|
||||
hide()
|
||||
|
||||
|
||||
func update_timer(score: String):
|
||||
label.text = score
|
||||
|
||||
|
||||
func init():
|
||||
update_timer(String(3))
|
||||
show()
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/ressources/font/joystix/ot/joystix monospace.otf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/decor/startTimerUI.gd" type="Script" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/decor/start_timer_UI.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 200
|
||||
|
|
@ -9,7 +9,7 @@ outline_size = 20
|
|||
outline_color = Color( 0, 0, 0, 1 )
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="startTimerUI" type="Control"]
|
||||
[node name="start_timer_UI" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = 0.00012207
|
||||
28
mini-game/scenes/effets/ScrollingBG.tscn
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scripts/ScrollingBG.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform float scroll_speed;
|
||||
|
||||
void fragment(){
|
||||
vec2 u = UV;
|
||||
u.x += scroll_speed*TIME;
|
||||
vec4 color = texture(TEXTURE,u);
|
||||
COLOR = color;
|
||||
}
|
||||
"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/scroll_speed = 0.2
|
||||
|
||||
[node name="ScrollingBG" type="TextureRect"]
|
||||
material = SubResource( 2 )
|
||||
stretch_mode = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
3
mini-game/scenes/effets/collision_obstacle.tscn
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[gd_scene format=2]
|
||||
|
||||
[node name="collision_obstacle" type="Area2D"]
|
||||
3
mini-game/scenes/effets/pick_bonus.tscn
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[gd_scene format=2]
|
||||
|
||||
[node name="pick_bonus" type="Area2D"]
|
||||
|
|
@ -1,5 +1,24 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/barrel.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="obstacle2" instance=ExtResource( 1 )]
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 28.3542, 36.1379 )
|
||||
|
||||
[node name="obstacle1" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.202437, 0.202437 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
|
||||
[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,26 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/malus_enveloppe.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="obstacle2" instance=ExtResource( 1 )]
|
||||
sprite_texture = ExtResource( 2 )
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 46.8347, 33.7529 )
|
||||
|
||||
[node name="obstacle2" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( -0.0556164, -0.166861 )
|
||||
scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
position = Vector2( -0.333708, -0.333708 )
|
||||
scale = Vector2( 4.70418, 3.36934 )
|
||||
[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,25 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/telephoneconference.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="obstacle3" instance=ExtResource( 1 )]
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
sprite_texture = ExtResource( 2 )
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 25.3346, 58.4363 )
|
||||
|
||||
[node name="notifier" parent="." index="2"]
|
||||
position = Vector2( 0.442123, 0 )
|
||||
[node name="obstacle3" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 1.45743, -10.024 )
|
||||
scale = Vector2( 0.0703989, 0.0703989 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
|
||||
position = Vector2( -1.33633, 0 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,25 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/telephoneflamme.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="obstacle4" instance=ExtResource( 1 )]
|
||||
scale = Vector2( 0.4, 0.4 )
|
||||
sprite_texture = ExtResource( 2 )
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 24.4662, 65.2837 )
|
||||
|
||||
[node name="notifier" parent="." index="2"]
|
||||
position = Vector2( 1.11176, 0 )
|
||||
[node name="obstacle4" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 0.832382, -16.9321 )
|
||||
scale = Vector2( 0.0711866, 0.0711866 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
|
||||
position = Vector2( 1.08099, -1.5749 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,28 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/dessin.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="obstacle5" instance=ExtResource( 1 )]
|
||||
scale = Vector2( 0.4, 0.4 )
|
||||
sprite_texture = ExtResource( 2 )
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 25.9509, 82.5121 )
|
||||
|
||||
[node name="notifier" parent="." index="2"]
|
||||
position = Vector2( 0.662247, -0.280617 )
|
||||
[node name="obstacle5" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_horizontal_guides_": [ ]
|
||||
}
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( -0.582159, -32.5956 )
|
||||
scale = Vector2( 0.073, 0.073 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
|
||||
position = Vector2( -1.05112, 3.99426 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]
|
||||
|
|
|
|||
|
|
@ -1,127 +0,0 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
var speed = Vector2.ZERO
|
||||
|
||||
export var jump_speed = 1100.0
|
||||
export var gravity = 60.0
|
||||
export var jump_time = 0.2
|
||||
export var max_lives = 1
|
||||
|
||||
enum {
|
||||
RUN,
|
||||
JUMP,
|
||||
IDLE
|
||||
}
|
||||
|
||||
enum {
|
||||
SCORE,
|
||||
TIME
|
||||
}
|
||||
|
||||
var jump_key = "dialogic_next"
|
||||
|
||||
var player_enabled = false
|
||||
|
||||
var state = RUN
|
||||
var au_sol = true
|
||||
|
||||
var current_lives = max_lives
|
||||
var pressing_jump = false
|
||||
|
||||
onready var animation := $AnimatedSprite
|
||||
onready var bonus_texture := $BonusControl/Sprite
|
||||
onready var bonus_tween := $BonusControl/Tween
|
||||
onready var bonus_timer := $BonusControl/Timer
|
||||
onready var jump_timer := $JumpTimer
|
||||
onready var jump_stream := $AudioStreamPlayer
|
||||
|
||||
signal hit()
|
||||
signal die()
|
||||
signal score()
|
||||
|
||||
func _ready():
|
||||
jump_timer.wait_time = jump_time
|
||||
stop()
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if player_enabled:
|
||||
match state:
|
||||
RUN:
|
||||
animation.play("man_run")
|
||||
JUMP:
|
||||
speed = Vector2.ZERO
|
||||
speed.y -= jump_speed
|
||||
animation.play("man_jump")
|
||||
if not pressing_jump:
|
||||
state = IDLE
|
||||
IDLE:
|
||||
pass
|
||||
speed.y += gravity
|
||||
move_and_collide(speed*delta)
|
||||
|
||||
|
||||
func _input(event: InputEvent):
|
||||
if player_enabled and state == RUN and event.is_action_pressed(jump_key):
|
||||
jump_timer.start()
|
||||
jump_stream.play()
|
||||
pressing_jump = true
|
||||
state = JUMP
|
||||
elif event.is_action_released(jump_key):
|
||||
jump_timer.stop()
|
||||
pressing_jump = false
|
||||
|
||||
|
||||
func _on_Area2D_body_entered(body):
|
||||
if body is StaticBody2D:
|
||||
state = RUN
|
||||
|
||||
|
||||
func _on_Area2D_body_exited(body):
|
||||
if body is StaticBody2D:
|
||||
state = JUMP
|
||||
|
||||
|
||||
func start():
|
||||
show()
|
||||
player_enabled = true
|
||||
|
||||
|
||||
func stop():
|
||||
hide()
|
||||
bonus_texture.modulate = Color(1, 1, 1, 0)
|
||||
player_enabled = false
|
||||
|
||||
|
||||
func hit():
|
||||
current_lives -= 1
|
||||
if current_lives > 0:
|
||||
emit_signal("hit")
|
||||
else:
|
||||
current_lives = 0
|
||||
emit_signal("die")
|
||||
|
||||
|
||||
func play_bonus_anim():
|
||||
bonus_texture.show()
|
||||
bonus_tween.stop_all()
|
||||
bonus_timer.stop()
|
||||
bonus_tween.interpolate_property(bonus_texture, "modulate", null, Color(1, 1, 1, 1), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
|
||||
bonus_tween.interpolate_property(bonus_texture, "position", Vector2(bonus_texture.position.x, 0), Vector2(bonus_texture.position.x, bonus_texture.position.y), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
|
||||
bonus_tween.start()
|
||||
bonus_timer.start()
|
||||
|
||||
|
||||
func bonus():
|
||||
play_bonus_anim()
|
||||
emit_signal("score")
|
||||
|
||||
|
||||
func _on_Timer_timeout() -> void:
|
||||
bonus_tween.stop_all()
|
||||
bonus_tween.interpolate_property(bonus_texture, "modulate", null, Color(1, 1, 1, 0), 0.3, Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
|
||||
bonus_tween.start()
|
||||
|
||||
|
||||
func _on_JumpTimer_timeout() -> void:
|
||||
pressing_jump = false
|
||||
6
mini-game/scenes/players/player1.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scripts/player1.gd" type="Script" id=1]
|
||||
|
||||
[node name="player1" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
[gd_scene load_steps=27 format=2]
|
||||
[gd_scene load_steps=25 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run7.png" type="Texture" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run5.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run6.png" type="Texture" id=3]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run3.png" type="Texture" id=4]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_jump2.png" type="Texture" id=5]
|
||||
[ext_resource path="res://mini-game/scenes/players/player.gd" type="Script" id=6]
|
||||
[ext_resource path="res://mini-game/scripts/player2.gd" type="Script" id=6]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run0.png" type="Texture" id=7]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run4.png" type="Texture" id=8]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run2.png" type="Texture" id=9]
|
||||
|
|
@ -21,21 +21,19 @@
|
|||
[ext_resource path="res://mini-game/ressources/sprites/player/man/6.png" type="Texture" id=19]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/7.png" type="Texture" id=20]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/9_1.png" type="Texture" id=21]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/plus1.png" type="Texture" id=22]
|
||||
[ext_resource path="res://mini-game/ressources/sounds/drop_004.wav" type="AudioStream" id=23]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 12 ), ExtResource( 11 ), ExtResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": "jump",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 7 ), ExtResource( 10 ), ExtResource( 9 ), ExtResource( 4 ), ExtResource( 8 ), ExtResource( 2 ), ExtResource( 3 ), ExtResource( 1 ) ],
|
||||
"loop": true,
|
||||
"name": "run",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 12 ), ExtResource( 11 ), ExtResource( 5 ) ],
|
||||
"loop": true,
|
||||
"name": "jump",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 18 ), ExtResource( 15 ), ExtResource( 14 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 13 ), ExtResource( 17 ) ],
|
||||
"loop": true,
|
||||
"name": "man_run",
|
||||
|
|
@ -53,9 +51,11 @@ extents = Vector2( 4.46927, 10.285 )
|
|||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 7.82863, 6.33675 )
|
||||
|
||||
[node name="player" type="KinematicBody2D"]
|
||||
[node name="player2" type="KinematicBody2D"]
|
||||
scale = Vector2( 10, 10 )
|
||||
script = ExtResource( 6 )
|
||||
jump_vitesse = 1000.0
|
||||
gravite = 40.0
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
position = Vector2( -1.76303, -0.98938 )
|
||||
|
|
@ -64,7 +64,7 @@ frames = SubResource( 1 )
|
|||
animation = "man_jump"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -0.0396847, -0.480505 )
|
||||
position = Vector2( -0.0396851, -0.480505 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
|
@ -73,26 +73,5 @@ shape = SubResource( 2 )
|
|||
position = Vector2( -0.0400658, 9.23466 )
|
||||
scale = Vector2( 0.609429, 0.281311 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="BonusControl" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="BonusControl"]
|
||||
position = Vector2( 0, -15 )
|
||||
scale = Vector2( 0.02, 0.02 )
|
||||
texture = ExtResource( 22 )
|
||||
|
||||
[node name="Tween" type="Tween" parent="BonusControl"]
|
||||
|
||||
[node name="Timer" type="Timer" parent="BonusControl"]
|
||||
wait_time = 1.5
|
||||
|
||||
[node name="JumpTimer" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 23 )
|
||||
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||
[connection signal="body_exited" from="Area2D" to="." method="_on_Area2D_body_exited"]
|
||||
[connection signal="timeout" from="BonusControl/Timer" to="." method="_on_Timer_timeout"]
|
||||
[connection signal="timeout" from="JumpTimer" to="." method="_on_JumpTimer_timeout"]
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
export var sprite_texture : Texture
|
||||
export var type := "bonus" setget , get_type
|
||||
export var scroll_speed = 9
|
||||
var speed_offset : float = 0
|
||||
|
||||
onready var sprite = $Sprite
|
||||
onready var audio_stream = $AudioStreamPlayer
|
||||
onready var timer = $Timer
|
||||
|
||||
var malus_sound = preload("res://mini-game/ressources/sounds/error_006.wav")
|
||||
var bonus_sound = preload("res://mini-game/ressources/sounds/select_006.wav")
|
||||
|
||||
var picked_up := false
|
||||
|
||||
|
||||
func _ready():
|
||||
sprite.texture = sprite_texture
|
||||
|
||||
|
||||
func _on_notifier_screen_exited() -> void:
|
||||
if not picked_up:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
move()
|
||||
|
||||
|
||||
func get_type():
|
||||
return type
|
||||
|
||||
|
||||
func move():
|
||||
self.position.x -= scroll_speed + speed_offset
|
||||
|
||||
|
||||
func pickup():
|
||||
picked_up = true
|
||||
timer.start()
|
||||
sprite.hide()
|
||||
if type == "bonus":
|
||||
audio_stream.stream = bonus_sound
|
||||
elif type == "malus":
|
||||
audio_stream.stream = malus_sound
|
||||
audio_stream.play()
|
||||
|
||||
|
||||
func _on_Area2D_body_entered(body: Node) -> void:
|
||||
if body.has_method("bonus") and body.has_method("hit"):
|
||||
pickup()
|
||||
if type == "bonus":
|
||||
body.bonus()
|
||||
elif type == "malus":
|
||||
body.hit()
|
||||
|
||||
|
||||
func _on_AudioStreamPlayer_finished() -> void:
|
||||
queue_free()
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/barrel.png" type="Texture" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/spawner/pickup.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 28.3542, 36.1379 )
|
||||
|
||||
[node name="pickup" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
sprite_texture = ExtResource( 1 )
|
||||
type = "malus"
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.202437, 0.202437 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
position = Vector2( 100, 0 )
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 3.0
|
||||
one_shot = true
|
||||
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
||||
[connection signal="screen_exited" from="notifier" to="." method="_on_notifier_screen_exited"]
|
||||
[connection signal="finished" from="AudioStreamPlayer" to="." method="_on_AudioStreamPlayer_finished"]
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
||||