Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

feat: add speech bubble functionality#22

Merged
jatoothless merged 3 commits intomainfrom
feat/speech-bubbles
Feb 22, 2026
Merged

feat: add speech bubble functionality#22
jatoothless merged 3 commits intomainfrom
feat/speech-bubbles

Conversation

@jatoothless
Copy link
Copy Markdown
Member

Nie jestem pewna jaki jest plan na integracje tego w samym projekcie więc roboczo są console logi.

  • Wczytuje z pliku JSON zawierającego podzielone ze względu na nastawienie
  • losuje linie o zadanym typie i wypisuje

@jatoothless jatoothless linked an issue Jan 6, 2026 that may be closed by this pull request
@jatoothless jatoothless added size/S and removed size/M labels Jan 6, 2026
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Feb 15, 2026
@jatoothless
Copy link
Copy Markdown
Member Author

Zintegrowałam z klientem. Pod klawiszem L wyświetla się dymek z losowym neutralnym tekstem

@jatoothless jatoothless requested a review from bnszky February 15, 2026 17:55
Copy link
Copy Markdown
Member

@bnszky bnszky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super napisane. Całość w pełni działa, dodałem tylko kilka uwag co do kodu

Comment thread src/rooms/GameRoom.ts Outdated
this.onMessage("generateLine", (client) => {
this.broadcast("line", {
sessionId: client.sessionId,
text: (new SpeechBubble).pickRandomLine("neutral")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

za kazdym razem gdy wysyłamy "line", to tworzy się nowy obiekt, co jest mało efektywne. Lepiej użyć static method lub singletonu:
private speechBubble = new SpeechBubble this.speechBubble.pickRandomLine()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

pickRandomLine(lineType: "positive" | "neutral" | "negative") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const map = {
    positive: this.positive,
    neutral: this.neutral,
    negative: this.negative
  };

w ten sposób można uniknąć switcha i powielania logiki

Copy link
Copy Markdown
Member

@bnszky bnszky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, teraz wystarczy, że pobierzesz najnowsze zmiany z maina wrocisz na ten branch feat/speech-bubbles i rebase. W skrócie:

  1. Pobieramy najnowsze zmiany w lokalnym repo:
git checkout main
git pull
  1. Wracamy na branch zmian i rebase:
git checkout feat/speech-bubbles
git rebase main
  1. Git automatycznie przechodzi po kazdym twoim commicie i robi auto merge. Jednak czasami wymagany jest manualny:
    Porównujesz niektóre pliki i wybierasz ręcznie zmiany i zapisujesz:
git add .

sprawdzamy czy wszystko poprawione

git status

gdy wszystko ok, to powtarzamy proces az procedura poprawy commitow sie skonczy

git rebase --continue

i wracamy znowu do punktu 3
4. Wszystko poprawione i rebase gotowy. Gdy przejdziemy przez wszystkie commity, to sie udalo. Dla bezpieczenstwa odpalamy client i server i sprawdzamy czy wszystko ok i nic nie jest zepsute. Gdy sa jakie bledy to dodajemy nowe commity z "fix"
5. Na koncu zeby wrzucic zmiany na repo, to wpisujemy 'git push --force-with-lease', ponieważ zmieniamy historię istniejących commitów na branchu (zwykły push nie zadziała)
6. Klikamy rebase and merge na githubie.

@jatoothless jatoothless merged commit bfe3492 into main Feb 22, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dodanie dymków z tekstem

2 participants