ゲームプレイ?§ | リーダーボード? |
---|---|
![]() | ![]() |
チキンインベーダーゲーム
├── 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)
この機能は、宇宙船で食べる場合、またはゲームの境界線に当たったときに、ドムからローストした鶏肉を除去するために使用されます。
プレーヤーレーザーと敵レーザーの作成を担当しています。
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()
すべての敵が破壊され、画面にプレゼントがない場合は真が返されます。
clamp(v,min,max)
プレーヤーを画面上の制限に保ち、プレーヤーにそれらを超えないように強制します
init()