게임 플레이? ️ | 리더 보드? |
---|---|
![]() | ![]() |
치킨 침략자 게임
├── README.md
├── about
│ ├── audio
│ │ └──spaceinvaders1.mpeg
│ └── js
│ └──about.js
└── css
├── App.css # Styles for instructions. Feel free to customize this as you desire.
├── home.css # Styles for index html file
├── leader.css # Styles for leaderboard html file
├──main.css # Styles for game html file
├──js
│ ├──board.js #contains logic for leader-board
│ ├──Config.js #contains the configurations for game loop
│ ├──Enemy.js #contains the Enemy Class
│ ├──Game.js #contains the Game Class
│ ├──Helper.js #contains some Helper functions
│ ├──home.js #contains player creation modal logic
│ ├──Laser.js #contains the Laser Class
│ ├──modal.js #contains the Pause modal logic
│ ├──Player.js #contains the Player Class
│ ├──Present.js #contains the Present Class
├── Images # Helpful images for the app. Use at your discretion.
│ ├── egg.png
│ ├── player-blue-1.png
│ └── laser-blue-1.png
├──sound #contains the game sounds
├── game.html #the game loop ui
├── index.html #the home page ui
├── Instructions.html #the instructions ui
├── leaderboard.html #the leaderboard ui
└── Main.js # You should not need to modify this file. It is used for the game main loop Logic.
닭을 만들고, 움직이는 방식, 죽는 방법 및 촬영 시간을 제작할 책임이 있습니다.
create($container, src)
이 기능은 닭 창조를 담당합니다.
destroy($container, enemy)
이것은 기능이 닭고기를 파괴하고 DOM에서 제거하는 데 사용됩니다.
이 수업은 구운 닭고기를 만들고 닭이 폭발 할 때 Dom에 추가하는 데 사용됩니다.
create($container, src)
이 기능은 구운 닭고기를 만들어 DOM에 추가하는 데 사용됩니다.
destroy($container, enemy)
이 기능은 우주선에서 먹거나 게임 테두리에 닿을 때 Dom에서 구운 닭을 제거하는 데 사용됩니다.
플레이어 레이저와 적 레이저를 만드는 책임이 있습니다.
create(container):
플레이어 레이저를 만들고 클래스 게임에서 생성 된 레이저를 레이저 배열로 밀어 넣을 책임이 있습니다.
createEnemyLaser(containers):
그것은 적의 레이저를 만들고 클래스 게임에서 생성 된 레이저를 관만 해어 배열로 밀어 넣을 책임이 있습니다.
updateLasers(dt,containers):
플레이어 레이저를 올바른 방향으로 이동하고 레이저가 적을 때리는지 확인합니다.
destroyLasers(containers,laser):
레이저를 파괴하고 DOM에서 제거 할 책임이 있습니다.
updateEnemyLasers(dt,containers):
적의 레이저를 올바른 방향으로 이동하고 레이저가 플레이어를 때리고 충돌이 발생하면 생명을 줄이는 것이 좋습니다.
플레이어 클래스는 플레이어를 만들고, 플레이어 위치 업데이트, 플레이어 파괴 및 승리하는 방법을 구현했습니다.
create($container, imgSrc)
새 플레이어 생성 (Dom Element)
update(dt, $container)
화면에서 플레이어의 위치를 업데이트합니다. 물리 법칙에 따라 거리를 계산합니다 : 거리 = 시간*속도.
destroy(container, player)
적 무기 (계란)에 맞은 후 화면에서 플레이어 인 Dom 요소를 제거합니다.
won()
모든 적들이 파괴되고 화면에 선물이 없으면 진실을 반환합니다.
clamp(v,min,max)
플레이어를 화면 제한에 유지하고 플레이어가 그들을 초과하지 않도록 강제
init()