File size: 7,410 Bytes
2a6d2b0
 
601f069
9fd3a67
2a6d2b0
9fd3a67
0bb733c
601f069
2a6d2b0
601f069
2a6d2b0
601f069
2a6d2b0
 
601f069
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2a6d2b0
 
601f069
 
 
2a6d2b0
601f069
 
 
 
 
 
9fd3a67
601f069
 
 
 
 
 
 
 
 
 
9fd3a67
601f069
 
 
 
 
 
 
 
 
 
 
 
 
2a6d2b0
601f069
2a6d2b0
601f069
2a6d2b0
 
 
601f069
 
 
 
 
2a6d2b0
 
 
601f069
2a6d2b0
 
 
601f069
2a6d2b0
 
0bb733c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2a6d2b0
0bb733c
 
 
 
 
 
 
 
 
9fd3a67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0bb733c
 
2a6d2b0
0bb733c
2a6d2b0
 
 
 
 
 
 
 
 
 
 
 
 
 
0bb733c
601f069
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html>
  <head>
    <title>Text to Survive - A text based horror escape game</title>
    <link rel="stylesheet" href="/static/assets/css/game-style.css" />
    <link rel="stylesheet" href="/static/assets/css/stress-animations.css" />
    <link rel="stylesheet" href="/static/assets/css/popup.css" />
  </head>

  <body>
    <div class="led-bar">
      <div class="light-beam"></div>
    </div>
    <div class="background-elements">
      <img
        src="/static/assets/img/blood-2.png"
        alt=""
        class="blood blood-top-left"
      />
      <img
        src="/static/assets/img/help.png"
        alt=""
        class="blood blood-top-right"
      />
      <img
        src="/static/assets/img/splatter.png"
        alt=""
        class="blood splatter"
      />
      <img
        src="/static/assets/img/hand.png"
        alt=""
        class="blood blood-bottom-right"
      />
    </div>
    <div id="gameContainer">
      <div id="mapSection">
        <div id="mapWrapper" class="map-wrapper">
          <!-- P5.js canvas goes here -->
        </div>
      </div>
      <div class="phone-mockup">
        <div class="phone-screen">
          <div id="chatSection">
            <div id="chatHeader">
              <div class="profile-picture">
                <img src="/assets/img/profil_pictures/no_stress.webp" alt="Profile Picture">
              </div>
              <div class="chat-name">Bae πŸ’–πŸ˜˜</div>
            </div>
            <div id="chatHistory"></div>
            <div id="chatControls">
              <input
                type="text"
                id="prompt"
                placeholder="Type your message..."
              />
              <button onclick="sendMessage()">
                <svg
                  width="683"
                  height="683"
                  viewBox="0 0 683 683"
                  fill="none"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M22.2666 1.86666C19.5999 2.93333 16.5333 4.39999 15.4666 5.19999C11.9999 8.13333 9.33325 15.7333 9.33325 22.5333C9.33325 28.1333 65.4666 283.333 66.9333 284.667C67.3333 285.067 339.333 332.267 372.4 337.733C381.733 339.333 389.333 340.933 389.333 341.333C389.333 341.733 381.733 343.333 372.4 344.933C339.2 350.4 67.3333 397.6 66.9333 398C65.4666 399.333 9.33325 654.533 9.33325 660.133C9.33325 675.867 21.0666 685.333 35.8666 681.333C42.6666 679.467 662.267 362 666.4 358.133C671.333 353.733 673.333 348.8 673.333 341.333C673.333 333.867 671.333 328.933 666.4 324.533C662.533 320.933 43.0666 3.19999 36.2666 1.33333C29.9999 -0.400007 28.5333 -0.266674 22.2666 1.86666Z"
                    fill="white"
                  />
                </svg>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="sound-button" onclick="toggleSound()">
      <img
        src="/static/assets/img/sondon.png"
        alt="Sound control"
        id="soundIcon"
      />
    </div>

    <audio id="bgMusic" loop>
      <source src="/static/assets/sounds/music.mp3" type="audio/mp3" />
    </audio>

    <audio id="messageSound">
      <source src="/static/assets/sounds/message.wav" type="audio/wav" />
    </audio>

    <div class="popup-overlay" style="display: none;"></div>
    <div class="popup-loser" style="display: none;">
      <div class="title-glow"></div>
      <h1 class="title">SHE DIED!</h1>
      <button class="play-again">Play Again</button>
      <img src="/static/assets/img/blood-2.png" alt="" class="blood-top" />
      <img src="/static/assets/img/popup/clown_lose.png" alt="" class="clown" />
      <img src="/static/assets/img/blood-2.png" alt="" class="blood-bottom" />
    </div>

    <div class="popup-winner" style="display: none;">
      <img src="/static/assets/img/popup/text.svg" alt="" class="win-text" />
      <img src="/static/assets/img/popup/fuck.png" alt="" class="fuck" />
      <img src="/static/assets/img/popup/stars1.png" alt="" class="stars1" />
      <img src="/static/assets/img/popup/stars2.png" alt="" class="stars2" />
      <button class="play-again">Play Again</button>
    </div>

    <script>
      function winGameModal() {
        document.querySelector('.popup-overlay').style.display = 'block';
        document.querySelector('.popup-winner').style.display = 'block';
        document.querySelector('.popup-loser').style.display = 'none';
      }

      function loseGameModal() {
        document.querySelector('.popup-overlay').style.display = 'block';
        document.querySelector('.popup-loser').style.display = 'block';
        document.querySelector('.popup-winner').style.display = 'none';
      }

      // Add click handlers for play again buttons
      document.querySelectorAll('.play-again').forEach(button => {
        button.addEventListener('click', () => {
          document.querySelector('.popup-overlay').style.display = 'none';
          document.querySelector('.popup-winner').style.display = 'none';
          document.querySelector('.popup-loser').style.display = 'none';
          location.reload(); // Reload the page to restart the game
        });
      });

      // Global function to set stress level
      function setStressLevel(level) {
        const chatSection = document.getElementById('chatSection');
        const profilePicture = chatSection.querySelector('.profile-picture img');
        
        // Remove all existing stress classes
        chatSection.classList.remove('no-stress', 'low-stress', 'very-stress');
        
        // Add the appropriate class based on stress level
        switch(level) {
          case 'no':
            chatSection.classList.add('no-stress');
            if (profilePicture) {
              profilePicture.src = '/assets/img/profil_pictures/no_stress.webp';
            }
            break;
          case 'low':
            chatSection.classList.add('low-stress');
            if (profilePicture) {
              profilePicture.src = '/assets/img/profil_pictures/low_stress.webp';
            }
            break;
          case 'very':
            chatSection.classList.add('very-stress');
            if (profilePicture) {
              profilePicture.src = '/assets/img/profil_pictures/very_stress.webp';
            }
            break;
          default:
            console.error('Invalid stress level:', level);
        }
      }
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.2/addons/p5.sound.min.js" "></script>
    <script src="/static/game/elmnts/furniture.js"></script>
    <script src="/static/game/gameState.js"></script>
    <script src="/static/game/mistral.js"></script>
    <script src="/static/game/elmnts/character.js"></script>
    <script src="/static/game/elmnts/girlfriend.js"></script>
    <script src="/static/game/elmnts/clown.js"></script>
    <script src="/static/game/elmnts/grid.js"></script>
    <script src="/static/game/elmnts/apt.js"></script>
    <script src="/static/game/utilities/sound.js"></script>
    <script src="/static/game/utilities/helpers.js"></script>
    <script src="/static/game/utilities/chat.js"></script>
    <script src="/static/game/utilities/draw.js"></script>
    <script src="/static/game/game.js"></script>

  
  </body>
</html>