Spaces:
Runtime error
Runtime error
Pedro de Carvalho commited on
Commit ·
b9b8e2c
1
Parent(s): 986f5d1
Update ui
Browse files- client/src/game/GameEngine.ts +2 -2
- client/src/pages/Game.tsx +15 -12
client/src/game/GameEngine.ts
CHANGED
|
@@ -487,8 +487,8 @@ export class GameEngine {
|
|
| 487 |
const isP2Bot = this.localMode && this.localPlayerTypes[1] === 'bot'
|
| 488 |
const hasBot = (isP1Bot || isP2Bot) && !(isP1Bot && isP2Bot)
|
| 489 |
|
| 490 |
-
if (hasBot && this.camera.vw >=
|
| 491 |
-
this.camera.offsetX = (isP2Bot ? -1 : 1) *
|
| 492 |
} else {
|
| 493 |
this.camera.offsetX = 0
|
| 494 |
}
|
|
|
|
| 487 |
const isP2Bot = this.localMode && this.localPlayerTypes[1] === 'bot'
|
| 488 |
const hasBot = (isP1Bot || isP2Bot) && !(isP1Bot && isP2Bot)
|
| 489 |
|
| 490 |
+
if (hasBot && this.camera.vw >= 768) {
|
| 491 |
+
this.camera.offsetX = (isP2Bot ? -1 : 1) * 125
|
| 492 |
} else {
|
| 493 |
this.camera.offsetX = 0
|
| 494 |
}
|
client/src/pages/Game.tsx
CHANGED
|
@@ -159,7 +159,7 @@ function getBotCharacter(
|
|
| 159 |
switch (opponentType) {
|
| 160 |
case 'streamer':
|
| 161 |
return {
|
| 162 |
-
name: '
|
| 163 |
title: 'Live Streamer',
|
| 164 |
quotes: {
|
| 165 |
start: [
|
|
@@ -191,7 +191,7 @@ function getBotCharacter(
|
|
| 191 |
}
|
| 192 |
case 'coach':
|
| 193 |
return {
|
| 194 |
-
name: '
|
| 195 |
title: 'Tactical Coach',
|
| 196 |
quotes: {
|
| 197 |
start: [
|
|
@@ -223,7 +223,7 @@ function getBotCharacter(
|
|
| 223 |
}
|
| 224 |
case 'analyst':
|
| 225 |
return {
|
| 226 |
-
name: '
|
| 227 |
title: 'Data Analyst',
|
| 228 |
quotes: {
|
| 229 |
start: [
|
|
@@ -258,8 +258,8 @@ function getBotCharacter(
|
|
| 258 |
switch (tauntStyle) {
|
| 259 |
case 'friendly':
|
| 260 |
return {
|
| 261 |
-
name: '
|
| 262 |
-
title: '
|
| 263 |
quotes: {
|
| 264 |
start: [
|
| 265 |
'Hey there! Let’s have a super fun game!',
|
|
@@ -290,8 +290,8 @@ function getBotCharacter(
|
|
| 290 |
}
|
| 291 |
case 'lover':
|
| 292 |
return {
|
| 293 |
-
name: '
|
| 294 |
-
title: '
|
| 295 |
quotes: {
|
| 296 |
start: [
|
| 297 |
'Hello, gorgeous. Let us weave our stones together on this grid.',
|
|
@@ -316,14 +316,14 @@ function getBotCharacter(
|
|
| 316 |
lose: [
|
| 317 |
'Losing to you is the greatest victory of all.',
|
| 318 |
'My heart is broken, but you look stunning in victory.',
|
| 319 |
-
'You’ve captured my stones and my soul. Well played,
|
| 320 |
],
|
| 321 |
},
|
| 322 |
}
|
| 323 |
case 'serious':
|
| 324 |
return {
|
| 325 |
-
name: '
|
| 326 |
-
title: '
|
| 327 |
quotes: {
|
| 328 |
start: [
|
| 329 |
'The match has commenced. No distractions.',
|
|
@@ -355,8 +355,8 @@ function getBotCharacter(
|
|
| 355 |
case 'funny':
|
| 356 |
default:
|
| 357 |
return {
|
| 358 |
-
name: '
|
| 359 |
-
title: 'Funny
|
| 360 |
quotes: {
|
| 361 |
start: [
|
| 362 |
'Prepare to be defeated by a highly sophisticated collection of if-statements!',
|
|
@@ -852,6 +852,7 @@ export default function Game() {
|
|
| 852 |
}
|
| 853 |
}
|
| 854 |
e.camera.setInitialZoom(e.boardSize, gameRules.swap2 ? 0.66 : 0.85)
|
|
|
|
| 855 |
|
| 856 |
const p1ColorNum = parseInt(p1ColorState.replace('#', '0x'), 16)
|
| 857 |
const p2ColorNum = parseInt(p2ColorState.replace('#', '0x'), 16)
|
|
@@ -1141,9 +1142,11 @@ export default function Game() {
|
|
| 1141 |
boxShadow: isBotThinking ? `0 0 8px ${botColor}` : 'none',
|
| 1142 |
animation: isBotThinking ? 'caro5-pulse 1s infinite alternate' : 'none',
|
| 1143 |
}} />
|
|
|
|
| 1144 |
<span style={{ fontSize: '0.8rem', color: theme.textMuted, fontWeight: 500 }}>
|
| 1145 |
{isBotThinking ? 'Calculating turn...' : 'Awaiting human move...'}
|
| 1146 |
</span>
|
|
|
|
| 1147 |
</div>
|
| 1148 |
</div>
|
| 1149 |
)}
|
|
|
|
| 159 |
switch (opponentType) {
|
| 160 |
case 'streamer':
|
| 161 |
return {
|
| 162 |
+
name: 'Vân Long',
|
| 163 |
title: 'Live Streamer',
|
| 164 |
quotes: {
|
| 165 |
start: [
|
|
|
|
| 191 |
}
|
| 192 |
case 'coach':
|
| 193 |
return {
|
| 194 |
+
name: 'Sư Long',
|
| 195 |
title: 'Tactical Coach',
|
| 196 |
quotes: {
|
| 197 |
start: [
|
|
|
|
| 223 |
}
|
| 224 |
case 'analyst':
|
| 225 |
return {
|
| 226 |
+
name: 'Trí Long',
|
| 227 |
title: 'Data Analyst',
|
| 228 |
quotes: {
|
| 229 |
start: [
|
|
|
|
| 258 |
switch (tauntStyle) {
|
| 259 |
case 'friendly':
|
| 260 |
return {
|
| 261 |
+
name: 'Hòa Long',
|
| 262 |
+
title: 'Harmonious Dragon',
|
| 263 |
quotes: {
|
| 264 |
start: [
|
| 265 |
'Hey there! Let’s have a super fun game!',
|
|
|
|
| 290 |
}
|
| 291 |
case 'lover':
|
| 292 |
return {
|
| 293 |
+
name: 'Ái Long',
|
| 294 |
+
title: 'Loving Dragon',
|
| 295 |
quotes: {
|
| 296 |
start: [
|
| 297 |
'Hello, gorgeous. Let us weave our stones together on this grid.',
|
|
|
|
| 316 |
lose: [
|
| 317 |
'Losing to you is the greatest victory of all.',
|
| 318 |
'My heart is broken, but you look stunning in victory.',
|
| 319 |
+
'You’ve captured my stones and my soul. Well played, beloved.',
|
| 320 |
],
|
| 321 |
},
|
| 322 |
}
|
| 323 |
case 'serious':
|
| 324 |
return {
|
| 325 |
+
name: 'Uy Long',
|
| 326 |
+
title: 'Majestic Dragon',
|
| 327 |
quotes: {
|
| 328 |
start: [
|
| 329 |
'The match has commenced. No distractions.',
|
|
|
|
| 355 |
case 'funny':
|
| 356 |
default:
|
| 357 |
return {
|
| 358 |
+
name: 'Du Rong',
|
| 359 |
+
title: 'Funny Dragon',
|
| 360 |
quotes: {
|
| 361 |
start: [
|
| 362 |
'Prepare to be defeated by a highly sophisticated collection of if-statements!',
|
|
|
|
| 852 |
}
|
| 853 |
}
|
| 854 |
e.camera.setInitialZoom(e.boardSize, gameRules.swap2 ? 0.66 : 0.85)
|
| 855 |
+
e.updateCameraOffset()
|
| 856 |
|
| 857 |
const p1ColorNum = parseInt(p1ColorState.replace('#', '0x'), 16)
|
| 858 |
const p2ColorNum = parseInt(p2ColorState.replace('#', '0x'), 16)
|
|
|
|
| 1142 |
boxShadow: isBotThinking ? `0 0 8px ${botColor}` : 'none',
|
| 1143 |
animation: isBotThinking ? 'caro5-pulse 1s infinite alternate' : 'none',
|
| 1144 |
}} />
|
| 1145 |
+
{!isFinished && (
|
| 1146 |
<span style={{ fontSize: '0.8rem', color: theme.textMuted, fontWeight: 500 }}>
|
| 1147 |
{isBotThinking ? 'Calculating turn...' : 'Awaiting human move...'}
|
| 1148 |
</span>
|
| 1149 |
+
)}
|
| 1150 |
</div>
|
| 1151 |
</div>
|
| 1152 |
)}
|