/2d-fight-game-JS

๐ŸŽฎ 2D fight game with JavaScript, HTML, Canvas

Primary LanguageJavaScript

2d-fight-game-JS

2D fight game with JavaScript, HTML, Canvas

URL

https://bugpigg-2d-fight-game.netlify.app/

Overview

example

Steps

Basic Fighting Game Mechanics

  1. Project Setup
    • html, js ํŒŒ์ผ ์ƒ์„ฑ
    • html canvas API ์ดˆ๊ธฐ ์„ค์ •
  2. Create Player and Enemy
    • Sprite ํด๋ž˜์Šค ์ƒ์„ฑ
    • Player, Enmey ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
    • ๊ฐ Sprite ์ธ์Šคํ„ด์Šค์˜ ์ดˆ๊ธฐ ์œ„์น˜ ์„ค์ • ๋กœ์ง ์ถ”๊ฐ€
  3. Move Characters with Event Listeners
    • Player, Enemy์˜ ์ด๋™ ํ‚ค ๋งคํ•‘
    • ์ •๊ตํ•œ ์ด๋™์„ ์œ„ํ•œ ๋ฆฌํŒฉํ† ๋ง
  4. Attacks
    • Player, Enemy์˜ attackBox ๊ตฌํ˜„
    • Player, Enemy์˜ ๊ณต๊ฒฉ ๋ฐฉํ–ฅ ์„ค์ •
  5. Health Bar Interface
    • HTML ์ด์šฉํ•˜์—ฌ Health Bar ๊ตฌํ˜„
  6. Game Timers and Game Over
    • Game Timer ๊ธฐ๋Šฅ ๊ตฌํ˜„
    • Game Over ๊ธฐ๋Šฅ ๊ตฌํ˜„

Sprites and Animation

  1. Background Sprite
    • ๋ฐฐ๊ฒฝ์€ game asset ์‚ฌ์ดํŠธ ์ฐธ์กฐ
      https://itch.io/
    • ํด๋ž˜์Šค, ์œ ํ‹ธ ์ž๋ฐ” ์Šคํฌ๋ฆฝํŠธ ๋ถ„๋ฆฌ
    • ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง€ ์ ์šฉ
  2. Shop Sprite with Animation
    • ๋ฐฐ๊ฒฝ์— Shop Sprite ์ถ”๊ฐ€
    • ์• ๋‹ˆ๋ฉ”์ด์…˜ ํšจ๊ณผ์ ์šฉ์„ ์œ„ํ•œ ์ฝ”๋“œ ์ถ”๊ฐ€
  3. Player Sprite
    • Idle, Run, Jump, Attakc์— ๋Œ€ํ•œ Player image ์ ์šฉ
  4. Enemy Sprite
    • Idle, Run, Jump, Attakc์— ๋Œ€ํ•œ Enemy image ์ ์šฉ
  5. React to Sprite Attacks
    • Attack Box๋ฅผ ํ†ตํ•œ ๊ณต๊ฒฉ ์œ ๋ฌด ํŒ๋ณ„ ์ ์šฉ
  6. Receive Animations
    • ๊ฐ Player๊ฐ€ ๊ณต๊ฒฉ ๋ฐ›์„์‹œ์˜ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ถ”๊ฐ€
  7. Death Animations
    • ๊ฐ Player ์‚ฌ๋ง์‹œ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ถ”๊ฐ€
  8. Interface Design and Animation
    • ์ฒด๋ ฅ๋ฐ” ๋””์ž์ธ ์ˆ˜์ •
    • ํƒ€์ด๋จธ ๋””์ž์ธ ์ˆ˜์ •
    • gsap cdn์„ ํ™œ์šฉํ•œ ์ฒด๋ ฅ๋ฐ” ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ˆ˜์ •

Wording

Reference