|
9 | 9 | </style> |
10 | 10 | </head> |
11 | 11 | <body> |
12 | | - <a href="https://github.com/thetechnocrat-dev/thetechnocrat-dev.github.io/blob/main/index.html#L158" target="_blank"> |
13 | | - <img src="github-logo.png" alt="GitHub Logo" width="24" height="24"> |
14 | | - <span>This game is open source</span> |
| 12 | + <a href="https://github.com/thetechnocrat-dev/thetechnocrat-dev.github.io/blob/main/index.html#L202" target="_blank" style="text-decoration: none; color: #3A78AB; font-family: Arial, sans-serif; font-size: 18px; background-color: #F8F9FA; border: 1px solid #3A78AB; border-radius: 5px; padding: 10px;"> |
| 13 | + <img src="github-logo.png" alt="GitHub Logo" width="24" height="24" style="vertical-align: middle; margin-right: 10px;"> |
| 14 | + <span>This Game is Open Source</span> |
15 | 15 | </a> |
| 16 | + |
16 | 17 | <canvas id="gameCanvas"></canvas> |
17 | 18 | <script> |
18 | 19 | var canvas = document.getElementById('gameCanvas'); |
|
92 | 93 | var endAngleOuter = startAngleOuter + Math.PI * 2 - player.radius * 3 / goal.radius; |
93 | 94 | var outerCircleRadius = goal.radius * 1.618 ** 3 |
94 | 95 | outerCirclePath.arc(goal.x, goal.y, outerCircleRadius, startAngleOuter, endAngleOuter); |
95 | | - ctx.strokeStyle = 'red'; |
96 | | - ctx.lineWidth = 5; |
| 96 | + ctx.strokeStyle = '#482475'; |
| 97 | + ctx.lineWidth = 8; |
97 | 98 | ctx.stroke(outerCirclePath); |
98 | 99 |
|
99 | 100 | // Create and store the path for the middle rotating circle |
|
103 | 104 | var endAngleMiddle = startAngleMiddle + Math.PI * 2 - player.radius * 3 / goal.radius; |
104 | 105 | var middleCircleRadius = goal.radius * 1.618 ** 2 |
105 | 106 | middleCirclePath.arc(goal.x, goal.y, middleCircleRadius, startAngleMiddle, endAngleMiddle); |
106 | | - ctx.strokeStyle = 'blue'; |
107 | | - ctx.lineWidth = 5; |
| 107 | + ctx.strokeStyle = '#482475'; |
| 108 | + ctx.lineWidth = 8; |
108 | 109 | ctx.stroke(middleCirclePath); |
109 | 110 |
|
110 | 111 | // Create and store the path for the inner rotating circle |
|
114 | 115 | var endAngleInner = startAngleInner + Math.PI * 2 - player.radius * 3 / goal.radius; |
115 | 116 | var innerCircleRadius = goal.radius * 1.618 |
116 | 117 | innerCirclePath.arc(goal.x, goal.y, innerCircleRadius, startAngleInner, endAngleInner); |
117 | | - ctx.strokeStyle = 'purple'; |
118 | | - ctx.lineWidth = 5; |
| 118 | + ctx.strokeStyle = '#482475'; |
| 119 | + ctx.lineWidth = 8; |
119 | 120 | ctx.stroke(innerCirclePath); |
120 | 121 |
|
121 | 122 | var playerPath = new Path2D(); |
|
171 | 172 | }, 1000); |
172 | 173 | } |
173 | 174 |
|
174 | | - |
175 | 175 | // Draw the player |
176 | 176 | ctx.beginPath(); |
177 | 177 | ctx.arc(player.x, player.y, player.radius, 0, Math.PI * 2); |
178 | | - ctx.fillStyle = 'blue'; |
| 178 | + ctx.fillStyle = '#3A78AB'; |
179 | 179 | ctx.fill(); |
180 | 180 |
|
181 | 181 | // Draw the goal |
182 | 182 | ctx.beginPath(); |
183 | 183 | ctx.arc(goal.x, goal.y, goal.radius, 0, Math.PI * 2); |
184 | | - ctx.fillStyle = 'green'; |
| 184 | + ctx.fillStyle = '#AA6C39'; |
| 185 | + ctx.fill(); |
| 186 | + |
| 187 | + // Draw the circle part of the keyhole |
| 188 | + ctx.beginPath(); |
| 189 | + ctx.arc(goal.x, goal.y - goal.radius / 4, goal.radius / 4, 0, Math.PI * 2, true); // true means counter-clockwise |
| 190 | + ctx.fillStyle = 'white'; |
185 | 191 | ctx.fill(); |
186 | 192 |
|
| 193 | + // Draw the triangular part of the keyhole |
| 194 | + ctx.beginPath(); |
| 195 | + ctx.moveTo(goal.x, goal.y - goal.radius / 4); // Starting point of the triangle (the tip) |
| 196 | + ctx.lineTo(goal.x - goal.radius / 4, goal.y + goal.radius / 2); // Bottom left corner of the triangle |
| 197 | + ctx.lineTo(goal.x + goal.radius / 4, goal.y + goal.radius / 2); // Bottom right corner of the triangle |
| 198 | + ctx.closePath(); |
| 199 | + ctx.fillStyle = 'white'; |
| 200 | + ctx.fill(); |
| 201 | + |
| 202 | + // Check for winning condition (within the keyhole) |
| 203 | + if (player.x > goal.x - goal.radius && player.x < goal.x + goal.radius && |
| 204 | + player.y > goal.y && player.y < goal.y + goal.radius) { |
| 205 | + alert("You win! Check the source code for a longer message"); |
| 206 | + /* |
| 207 | + Godel's Gauntlet is an impossible game due to self-referencing of the player's position. |
| 208 | + You must win by contradicting the coded rules of the game and changing the source code. |
| 209 | + (Or for the lazy peek at the source code.) To join my semi-secret math hacker club, |
| 210 | + please dm me the answer to the following riddle: |
| 211 | + |
| 212 | + When you measure how I rise over time, you are just measuring me, what am I? |
| 213 | + */ |
| 214 | + player.target = {}; |
| 215 | + player.reset = true; |
| 216 | + player.freeze = true; |
| 217 | + setTimeout(function() { |
| 218 | + console.log('done freeze') |
| 219 | + player.freeze = false; |
| 220 | + player.x = canvas.width / 2; |
| 221 | + player.y = 50; |
| 222 | + player.vx = 0; |
| 223 | + player.vy = 0; |
| 224 | + }, 1000); |
| 225 | + } |
| 226 | + |
| 227 | + |
187 | 228 | // Request next animation frame |
188 | 229 | requestAnimationFrame(gameLoop); |
189 | 230 | } |
|
0 commit comments