/SpaceInvadersClient

Space Invaders Web Client

Primary LanguageTypeScript

SpaceInvaders

This was my submission to the 2019 Airbus Code Competition in Germany where I achieved the third place. It is a simple, web-based implementation of the well-known space invaders game, featuring a local multiplayer and multiple difficulty levels.

The space invaders application consists of a client and a server. The client is based on Angular and handles the actual gameplay, whereas the server uses ASP.NET CORE and an SQLite database to store the scores achieved by the players. Hence, both the client and server have to be installed for the application to work.

After downloading the git repositories and installing the required packages, please refer to the Execution section.

Table of Contents

  1. Client Installation Guide
  2. Server Installation Guide
  3. Executing the Application

SpaceInvadersClient

Installation

1. Install node.js

Angular 8 requires node.js 10.9 or greater

Windows

Download and install node.js from the official website.

Ubuntu

# if required, install curl
sudo apt-get install -y curl

# install nodejs version >= 10.9
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

2. Install npm Package Manager

Windows

The npm package manager will be installed automatically with the download of the node.js executable described in step 1. You can verify that it is installed on your computer by executing npm -v in a cmd window.

Ubuntu

sudo apt-get install -y npm

3. Install Angular

Windows

Execute the following commands in a cmd window:

npm install -y -g @angular/cli

Ubuntu

sudo npm install -y -g @angular/cli

4. Install Project Dependencies

Make sure you are in the main directory of the SpaceInvadersClient project or provide the path to the package.json file located in the project folder to the npm install command as an argument.

Windows

# The following command will install every package listed in the package.json file
npm install

Ubuntu

# The following command will install every package listed in the package.json file
sudo npm install

SpaceInvadersServer

The git repository of the server can be found here. It is based on C# and requires .NET Core SDK version 2.2.

Installation

Windows

Download and execute the .NET Core 2.2 SDK installer from the official website.

Ubuntu

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get install dotnet-sdk-2.2

The documentation for installing dotnet on a system running a different os can be found here.

Execution

Since this application uses HTML5, it is strongly recommended to use the latest version of the Firefox, Chrome or Safari browsers for the application to function properly.

Launch Server and Client Application

Windows

Navigate to the folder containing the server application and execute the following command in a cmd window:

# Launch the server
dotnet run SpaceInvadersServer.csproj

Navigate to the folder containing the client application and execute the following command in a cmd window:

# Launch the client application
ng serve

Ubuntu

Navigate to the folder containing the files for the server. Execute the following command in a separate terminal window:

# Launch the server
dotnet run SpaceInvadersServer.csproj

Navigate to the folder containing the client application. Execute the following command in a terminal:

# Launch the client application
ng serve

Open Application in Browser

With both the server and the client up and running, navigate to https://localhost:4200 to play the game. Enjoy!