Git Product home page Git Product logo

javascript-game-break-out's Introduction

JavaScript Break-Out 게임

게임 플레이

only html, css, js

Click here to try

프로젝트 구조

  • index.html: 게임 캔버스가 포함된 HTML 파일.
  • styles/: 게임의 CSS 파일이 있는 폴더.
  • classes/: 게임 로직을 구현하는 클래스 파일이 포함된 폴더.
  • main.js: 게임 초기화 및 설정을 담당하는 파일.

주요 클래스

Ball 클래스

  • 속성: 위치, 속도, 반경
  • 메서드: draw(), move(), checkCollision()

Paddle 클래스

  • 속성: 위치, 너비, 높이
  • 메서드: draw(), move()

Brick 클래스

  • 속성: 위치, 너비, 높이, 상태
  • 메서드: draw(), hit()

Game 클래스

  • 속성: Ball, Paddle, Brick 인스턴스 배열, 점수, 생명
  • 메서드: init(), update(), draw(), checkCollisions(), gameOver()

클래스 상호작용

  • Game 클래스는 Ball, Paddle, Brick 클래스의 인스턴스를 생성하고 관리.
  • Ball 클래스는 PaddleBrick 클래스와 충돌 감지를 통해 상호작용.
  • BallPaddle에 충돌하면 반사되고, Brick에 충돌하면 벽돌이 파괴됨.
  • Game 클래스는 각 프레임마다 Ball, Paddle, Brick의 상태를 업데이트하고 화면에 그리는 역할.

javascript-game-break-out's People

Contributors

doongeon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.