Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 캐릭터 이미지, 맵, 캐릭터 위치 조정 및 채팅관련 스타일 수정 #72

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified client/public/players/player1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/public/players/player2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/public/players/player3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/public/players/player4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/public/players/player5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/public/players/player6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Metadata } from "next";
import { Noto_Sans_KR } from "next/font/google";
import JotaiProvider from "@/jotai/jotaiProvider";
import ModalProvider from "@/components/modal/modalProvider/modalProvider";
import { QueryProvider } from "@/query/queryProvider";
import NewQueryProviders from "@/query/newQueryProvider";
import Analysis from "./analysis";
import "../styles/reset.css";
Expand All @@ -19,7 +18,6 @@ const RootLayout = ({ children }: { children: React.ReactNode }) => {
return (
<html lang="ko">
<body className={noto_Sans_KR.className}>
{/* <QueryProvider> */}
<NewQueryProviders>
<JotaiProvider>
<ModalProvider>
Expand All @@ -28,7 +26,6 @@ const RootLayout = ({ children }: { children: React.ReactNode }) => {
</ModalProvider>
</JotaiProvider>
</NewQueryProviders>
{/* </QueryProvider> */}
</body>
</html>
);
Expand Down
1 change: 1 addition & 0 deletions client/src/components/chat/chat.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

.chat_main {
padding-top: 15px;
padding-bottom: 15px;
padding-right: 12px;
border-top: 1px solid $border-color;
border-bottom: 1px solid $border-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useMessage = ({
};

const sendMessage = () => {
if (!message) return;
if (!message || !message.trim()) return;

const messageInfo = {
roomId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
}

.send_button {
width: 24px;
height: 24px;
width: 28px;
height: 28px;
border-radius: 50%;

background-image: url(/icons/send.svg);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.messsage_list {
.message_list {
display: flex;
flex-flow: column nowrap;
row-gap: 10px;
row-gap: 14px;
}
2 changes: 1 addition & 1 deletion client/src/components/chat/messageList/messageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MessageList = (props: Props) => {
const isMyMessage = (nickname: string) => nickname === user?.userName;

return (
<ul className={style.messsage_list}>
<ul className={style.message_list}>
{messages.map((message, index) => {
return isMyMessage(message.nickname) ? (
<MyMessage key={index} message={message.message} time={message.time} />
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/chat/myMessage/myMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const MyMessage = (props: IMessageProps) => {
const { message, time } = props;

return (
<div className={style.container}>
<li className={style.container}>
<div className={style.wrapper}>
<div className={style.message_wrapper}>
<span className={style.time}>{formatTimeFromISO(time)}</span>
<div className={style.message_main}>{message}</div>
</div>
</div>
</div>
</li>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ReceivedMessage = (props: IMessageProps) => {
const { nickname, message, time } = props;

return (
<div className={style.container}>
<li className={style.container}>
<div className={style.avatar} />
<div className={style.wrapper}>
<span className={style.nickname}>{nickname}</span>
Expand All @@ -20,7 +20,7 @@ const ReceivedMessage = (props: IMessageProps) => {
<span className={style.time}>{formatTimeFromISO(time)}</span>
</div>
</div>
</div>
</li>
);
};

Expand Down
34 changes: 24 additions & 10 deletions client/src/components/phaser/map/phaserScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,22 @@ export class MeetsInPhaserScene extends Phaser.Scene {
this.load.tilemapTiledJSON("map", "/map/map.json");
for (let i = 1; i <= 6; i++) {
this.load.spritesheet(`player${i}`, `/players/player${i}.png`, {
frameWidth: 16,
frameHeight: 16,
frameWidth: 32,
frameHeight: 32,
Copy link
Collaborator

Choose a reason for hiding this comment

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

이미지 화질 때문에 여기선 32px로 넣고 setDisplaySize로 16px로 보여지게 하는 건가요??

});
}
}

create(): void {
const map = this.make.tilemap({ key: "map" });
const { width: canvasWidth, height: canvasHeight } = this.sys.game.canvas;
const width = canvasWidth / 4 - (map.width * 16) / 2;
const height = canvasHeight / 4 - (map.height * 16) / 2;

// 맵의 실제 픽셀 크기
const mapPixelWidth = map.width * 16;
const mapPixelHeight = map.height * 16;

const width = 0;
const height = 0;

const tileBase = map.addTilesetImage("base", "base")!;
const tileIndoor = map.addTilesetImage("indoor", "indoor")!;
const tileUrban = map.addTilesetImage("urban", "urban")!;
Expand All @@ -126,8 +131,9 @@ export class MeetsInPhaserScene extends Phaser.Scene {

layerChairBack!.setDepth(2);

this.physics.world.setBounds(0, 0, map.widthInPixels, map.heightInPixels);
this.cameras.main.setBounds(0, 0, map.widthInPixels, map.heightInPixels);
this.cameras.main.setBounds(0, 0, mapPixelWidth, mapPixelHeight);
this.physics.world.setBounds(0, 0, mapPixelWidth, mapPixelHeight);
this.cameras.main.centerOn(mapPixelWidth / 2, mapPixelHeight / 2);

this.layerBlockOutdoor.setCollisionByExclusion([-1]);
this.layerBlockWall.setCollisionByExclusion([-1]);
Expand Down Expand Up @@ -330,7 +336,12 @@ export class MeetsInPhaserScene extends Phaser.Scene {

private emitPlayerMovement(player: Phaser.Physics.Arcade.Sprite, direction: Direction): void {
if (!player || !this.socket) return;
this.socket.emit("move", { x: player.x, y: player.y, roomId: this.roomId, direction });
this.socket.emit("move", {
x: player.x,
y: player.y,
roomId: this.roomId,
direction,
});
}

private emitStopMovement(): void {
Expand All @@ -343,12 +354,12 @@ export class MeetsInPhaserScene extends Phaser.Scene {

this.otherPlayers.getChildren().forEach((otherPlayer) => {
const player = otherPlayer as OtherPlayerType;
player.nameTag.x = player.x + player.width / 2;
player.nameTag.x = player.x + player.displayWidth / 2;
player.nameTag.y = player.y - 15;
});

if (this.player && this.player.nameTag) {
this.player.nameTag.x = this.player.x + this.player.width / 2;
this.player.nameTag.x = this.player.x + this.player.displayWidth / 2;
this.player.nameTag.y = this.player.y - 15;
}
}
Expand Down Expand Up @@ -403,6 +414,7 @@ export class MeetsInPhaserScene extends Phaser.Scene {
player.anims.play(`idle-down-${this.myCharacterId}`);
player.setOrigin(0, 0);
player.setSize(16, 16);
player.setDisplaySize(16, 16);

this.physics.add.collider(player, this.layerBlockOutdoor);
this.physics.add.collider(player, this.layerBlockWall);
Expand Down Expand Up @@ -435,6 +447,8 @@ export class MeetsInPhaserScene extends Phaser.Scene {
otherPlayer.setCollideWorldBounds(true);
otherPlayer.anims.play(`idle-down-${playerInfo.characterId}`);
otherPlayer.setOrigin(0, 0);
otherPlayer.setSize(16, 16);
otherPlayer.setDisplaySize(16, 16);
otherPlayer.playerId = playerInfo.playerId;
otherPlayer.characterId = playerInfo.characterId;
otherPlayer.nameTag = this.createNameTag(
Expand Down
16 changes: 0 additions & 16 deletions client/src/query/queryProvider.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions server/src/modules/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export class AuthController {
res.clearCookie("access_token", {
...this.cookieOptions,
expires: new Date(0),
maxAge: 0
})
return res.status(200)
maxAge: 0,
});
return res.status(200).send({ message: "로그아웃 성공" });
}
}
}
4 changes: 2 additions & 2 deletions server/src/modules/phaser/phaser.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export class PhaserGateway implements OnGatewayConnection, OnGatewayInit, OnGate

const playerInfo = {
rotation: 0,
x: 360,
y: 192,
x: 392,
y: 184,
playerId: socket.id,
user: socket.data.user,
characterId: characterId, // 캐릭터 ID 추가
Expand Down