/hostile-aliens

A timed tech test to write a simple OOP game in JS in under 150 lines

Primary LanguageHTML

Hostile aliens Description A group of hostile aliens have parked up in earth's orbit, we need to strike first! Create a simple text only game with a single button that hits a random alien ship in the fleet. Each time the button is pressed, a random alien ship is hit and its hit points are reduced. Once an alien ships points have hit zero the ship is destroyed and can’t be hit again. The game is over once all alien ships have been destroyed. Requirements You should be able to start a new game once the game is over. Some text visualisation of the ships and their hit points. The game should have the following Alien ships: 1 x Mother ship 100 Hit Points
Loses 9 hit points every time it is hit
All ships are destroyed if the Mother ship is destroyed 5 x Defence ship
Each one starts with 80 hit points
Each one Loses 10 hit points each time it is hit 8 x Attack ship Each starts with 45 hit points
Each loses 12 hit points each time it is hit. Rules You may only use JS / CSS / HTML, no frameworks or libraries. You should be able to solve this in under 150 lines including comments (excluding unit tests) and any more than that is a sign you have over complicated the problem. Use an Object Oriented Programming approach. You can use basic html and css to tidy up the output but no more It should all be in one html file.