Skip to content

Commit

Permalink
readme with new info, some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hmbanan666 committed Jun 18, 2024
1 parent ee65134 commit 7fcef25
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 124 deletions.
57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
# [Twitch Chat Game] Royal Madness 👑
# 👑 Chat Game for Twitch

📺🎮 [Building and playing it live](https://www.twitch.tv/hmbanan666) 👾 [Our community](https://discord.gg/B6etUajrGZ)
- 🏠 [Game Website](https://chatgame.space)
- 📺 [Developing and playing it live](https://www.twitch.tv/hmbanan666)
- 👾 [Our community in Discord](https://discord.gg/B6etUajrGZ)

![Screen](https://github.com/hmbanan666/royal-madness-twitch-game/assets/25910785/a80009a5-ac75-4935-afd2-e1aae16285d6)
![Screen](https://github.com/hmbanan666/chat-game/assets/25910785/a22468a4-0bf1-43e3-91fc-23a1e2a675fc)

🤔 Imagine an open world where your Hero can:
🤔 Imagine procedurally generated world where you and your viewers can:

- 🗺️ **Travel**, **defeat** creatures and **find** an infinite number of quests
- 💎 **Gather** loot and a variety of materials
- 🏗️ **Construct** buildings with other Heroes
- 💬 **Chat** with other Heroes in real time
- 🏆 **Earn** more than 1000 achievements!
- 💬 **Use commands** in chat to see actions in real time
- 🗺️ **Travel** with the Machine
- 🦄 **Complete** main and side quests from game characters
- 💎 **Gather** a variety of materials
- 🏗️ **Construct** buildings
- 🏆 **Earn** achievements!

Let's build a similar world together!
Let's build a similar world together! ⭐️ Become a Stargazer ⭐️

## What will be here?
## 🧱 Stack

- [Front] Web client for the game made with **Typescript**, **React**
- simple graphics, top view camera
- interface, menu, inventory slots...
- [Back] Server on **Bun**, where will be a storage for progress of all Heroes
- [PixiJS](https://pixijs.com/): The HTML5 Creation Engine.
- [Svelte](https://svelte.dev/): A new way to build web applications. It's a compiler that takes your declarative components and converts them into efficient JavaScript that surgically updates the DOM.
- [SvelteKit](https://kit.svelte.dev/): A framework for rapidly developing robust, performant web applications using Svelte.
- [Twurple](https://twurple.js.org/): A set of libraries that aims to cover all existing Twitch APIs.
- [Prisma](https://www.prisma.io/): Next-generation Node.js and TypeScript ORM.
- [Howler.js](https://howlerjs.com/): Audio library for the modern web.
- [Lucide Svelte](https://lucide.dev/guide/packages/lucide-svelte): An open-source icon library.
- [Bun](https://bun.sh/): An all-in-one JavaScript runtime & toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager.
- [TypeScript](https://www.typescriptlang.org/): A strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
- [ESLint](https://eslint.org/): Statically analyzes a code to quickly find problems.

## Why?
## 🕹️ How to develop

- I want to take a break from product development and develop some game that myself would play in the evenings.
- It will be made using front and back parts, with good code practices (hope so 😀).
- Want to discover something new in software development. Some new challenges and their overcoming!
- I enjoy the new achievements on GitHub, especially Starstruck x4: "Created a repository that has 4096 stars". Why not
to try?
Clone this repo and use standard commands:

⭐️ Become a Stargazer ⭐️ Star this repo. Make forks, issues, PRs, and have fun! Thanks for your ideas and activity! 😉
```shell
git clone https://github.com/hmbanan666/chat-game
bun install
bun run dev
```

## 🪀 License

This project is licensed under the MIT License - see the [**MIT License**](https://github.com/hmbanan666/chat-game/blob/main/LICENSE) file for details.
Binary file modified bun.lockb
Binary file not shown.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@
"howler": "2.2.4",
"jsonwebtoken": "9.0.2",
"lucide-svelte": "0.395.0",
"pixi.js": "8.1.6"
"pixi.js": "8.1.7"
},
"devDependencies": {
"@antfu/eslint-config": "2.21.1",
"@sveltejs/kit": "2.5.11",
"@sveltejs/kit": "2.5.16",
"@sveltejs/vite-plugin-svelte": "3.1.1",
"@types/bun": "1.1.4",
"@types/howler": "2.2.11",
"@types/jsonwebtoken": "9.0.6",
"eslint": "9.4.0",
"eslint-plugin-svelte": "2.39.3",
"eslint": "9.5.0",
"eslint-plugin-svelte": "2.40.0",
"madge": "7.0.0",
"prisma": "5.15.0",
"svelte": "4.2.18",
"svelte-adapter-bun": "0.5.2",
"svelte-check": "3.8.0",
"svelte-eslint-parser": "0.37.0",
"svelte-check": "3.8.1",
"svelte-eslint-parser": "0.39.1",
"typescript": "5.4.5",
"vite": "5.3.1"
}
Expand Down
49 changes: 24 additions & 25 deletions src/lib/game/services/chunk/baseChunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
} from '$lib/game/services/chunk/interface'
import { FlagObject } from '$lib/game/objects/flagObject'

interface IGameChunkOptions {
interface BaseChunkOptions {
center: GameChunk['center']
title: GameChunk['title']
type: GameChunk['type']
Expand All @@ -41,7 +41,7 @@ export class BaseChunk implements GameChunk {
height,
center,
game,
}: IGameChunkOptions) {
}: BaseChunkOptions) {
this.id = createId()
this.center = center
this.title = title
Expand All @@ -53,29 +53,7 @@ export class BaseChunk implements GameChunk {

live() {}

#initArea({
width,
height,
theme,
}: {
width: number
height: number
theme: IGameChunkTheme
}) {
const halfWidth = Math.round(width / 2)
const halfHeight = Math.round(height / 2)

const area = {
startX: this.center.x - halfWidth,
endX: this.center.x + halfWidth,
startY: this.center.y - halfHeight,
endY: this.center.y + halfHeight,
}

this.area = new Area({ game: this.game, theme, area })
}

public getRandomPoint() {
get randomPoint() {
return {
x: getRandomInRange(this.area.area.startX, this.area.area.endX),
y: getRandomInRange(this.area.area.startY, this.area.area.endY),
Expand Down Expand Up @@ -146,4 +124,25 @@ export class BaseChunk implements GameChunk {
get wagonStop(): IGameBuildingWagonStop | undefined {
return this.game.children.find((b) => b.type === 'WAGON_STOP') as IGameBuildingWagonStop | undefined
}

#initArea({
width, height, theme,
}: {
width: number
height: number
theme: IGameChunkTheme
}) {
const halfWidth = Math.round(width / 2)
const halfHeight = Math.round(height / 2)

const area = {
startX: this.center.x - halfWidth,
endX: this.center.x + halfWidth,
startY: this.center.y - halfHeight,
endY: this.center.y + halfHeight,
}

this.area = new Area({ game: this.game, theme, area })
this.area.init()
}
}
4 changes: 2 additions & 2 deletions src/lib/game/services/chunk/forestChunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ForestChunk extends BaseChunk implements IGameForestChunk {

#initTrees(count: number) {
for (let i = 0; i < count; i++) {
const point = this.getRandomPoint()
const point = this.randomPoint
const size = getRandomInRange(75, 90)
new TreeObject({
game: this.game,
Expand All @@ -55,7 +55,7 @@ export class ForestChunk extends BaseChunk implements IGameForestChunk {

#initStones(count: number) {
for (let i = 0; i < count; i++) {
const point = this.getRandomPoint()
const point = this.randomPoint
new StoneObject({
game: this.game,
x: point.x,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/game/services/chunk/lakeChunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
IGameLakeChunk,
} from '$lib/game/services/chunk/interface'

interface ILakeOptions {
interface LakeChunkOptions {
game: Game
center: IGameLakeChunk['center']
width: number
Expand All @@ -20,7 +20,7 @@ interface ILakeOptions {
}

export class LakeChunk extends BaseChunk implements IGameLakeChunk {
constructor({ game, width, height, center, theme }: ILakeOptions) {
constructor({ game, width, height, center, theme }: LakeChunkOptions) {
super({
game,
width,
Expand Down Expand Up @@ -54,7 +54,7 @@ export class LakeChunk extends BaseChunk implements IGameLakeChunk {

#initTrees(count: number) {
for (let i = 0; i < count; i++) {
const point = this.getRandomPoint()
const point = this.randomPoint
const size = getRandomInRange(75, 90)
new TreeObject({
game: this.game,
Expand All @@ -70,7 +70,7 @@ export class LakeChunk extends BaseChunk implements IGameLakeChunk {

#initStones(count: number) {
for (let i = 0; i < count; i++) {
const point = this.getRandomPoint()
const point = this.randomPoint
new StoneObject({
game: this.game,
x: point.x,
Expand Down
Loading

0 comments on commit 7fcef25

Please sign in to comment.