Skip to content

Commit

Permalink
[feat] change the speed of the ball (need to test)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyNot077 committed Dec 15, 2023
1 parent 131e68f commit 93fa241
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions project/backend/src/pong/pong.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@ import { EventEmitter } from 'events';
import { PrismaService } from '../base/prisma.service';
import { idOf, UserId } from '../common/Id';

// 게임 상수
// 게임 보드
const BOARD_WIDTH = 800;
const BOARD_HEIGHT = 500;
const GAME_OVER = 7;

// 패들
const PADDLE_WIDTH = 10;
const PADDLE_HEIGHT = 80;
const SMALL_PADDLE_HEIGHT = 50;
const SMALL_PADDLE_STRIKE = 2;

// 공
const BALL_SIZE = 15;
const DEFAULT_SPEED = 3;
const SMASH_SPEED = 8;
const DEFAULT_SPEED = 6;
const SMASH_SPEED = 12;
const PADDLE_STRIKE = 4;
const PADDLE_MOVE_STEP = 20;

// 아이템
const ITEM_SIZE = 100;
const GAME_OVER = 7;

export interface GameState {
ball: { x: number; y: number; type: number };
Expand Down
4 changes: 2 additions & 2 deletions project/frontend/src/components/pong/gameConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const PADDLE_STRIKE = 4;

// 공
export const BALL_SIZE = 15;
export const DEFAULT_SPEED = 3;
export const SMASH_SPEED = 8;
export const DEFAULT_SPEED = 6;
export const SMASH_SPEED = 12;

// 아이템
export const ITEM_SIZE = 100;
Expand Down

0 comments on commit 93fa241

Please sign in to comment.