Gameplay ๐น๏ธ | Leaderboard ๐ |
---|---|
โโโ 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.
Is responsible for creating the chickens , the way they move , how they die and the time they shoot.
create($container, src)
This function is responsible for the chicken creation.
destroy($container, enemy)
This is function is used to destroy the chicken and removing it from the DOM.
This class is used to create roasted chicken and append it to the DOM when the chicken explodes.
create($container, src)
This function is used to create the roasted chicken and append it to the DOM.
destroy($container, enemy)
This function is used to remove the roasted chicken from the DOM if it is eaten by the space ship or when it hits the game border.
is responsible for creating the player laser and enemy laser .
create(container):
it is responsible for creating player laser and pushing the created laser to the Laser array in the class Game.
createEnemyLaser(containers):
it is responsible for creating enemy laser and pushing the created laser to the enemyLaser array in the class Game
updateLasers(dt,containers):
it is responsible for moving player laser in right direction & check if the laser hit the enemy
destroyLasers(containers,laser):
it is responsible for destroy the laser and remove it from Dom
updateEnemyLasers(dt,containers):
it is responsible for moving enemy laser in right direction & check if the laser hit the player and decrease the lives if the collision is happened
Player class has implemented methods for creating the player, updating player position, destroying the player, and winning
create($container, imgSrc)
Creates a new player (Dom element)
update(dt, $container)
Updates the position of the player on the screen. It calculates the distance based on the physics law: distance=time*speed.
destroy(container, player)
Removes the player, the DOM element, from the screen after getting hit by the enemy weapon (eggs).
won()
Returns true if all enemies are destroyed and no presents on the screen.
clamp(v,min,max)
Keeps the player on the screen limits and force the player not to Exceed them
init()
- It is responsible for initating the game by creating all the enemies
- Creates the Player
- Handles the Spacing between the chickens
- Handles the level logic