Chicken invaders game
1.0.0
遊戲玩法? | 排行榜? |
---|---|
![]() | ![]() |
雞肉入侵者遊戲
├── 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元素)
update(dt, $container)
更新播放器在屏幕上的位置。它根據物理定律計算距離:距離=時間*速度。
destroy(container, player)
被敵方武器擊中後,將播放器,DOM元素從屏幕上刪除。
won()
如果所有敵人都被摧毀並且在屏幕上沒有禮物,則返回為TRUE。
clamp(v,min,max)
將播放器保持在屏幕限制上,並迫使玩家不要超越他們
init()