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()