An open API service indexing awesome lists of open source software.

https://github.com/jsolly/geoasteroids


https://github.com/jsolly/geoasteroids

asteroids game typescript

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# GeoAsteroids
[![GeoAsteroidsTest](https://github.com/jsolly/GeoAsteroids/actions/workflows/GeoAsteroidsTest.yml/badge.svg)](https://github.com/jsolly/GeoAsteroids/actions/workflows/GeoAsteroidsTest.yml)
[![Coverage Status](https://coveralls.io/repos/github/jsolly/GeoAsteroids/badge.svg?branch=main)](https://coveralls.io/github/jsolly/GeoAsteroids?branch=main)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)

A 2D spaceship game, Geoasteroids.com

![GeoAsteroids_playthrough (3)](https://user-images.githubusercontent.com/9572232/179308016-71265497-1d05-4750-bfd5-0f336cf7ae77.gif)

---

## Table of Contents

- [Installation](#installation)
- [Features](#features)
- [Contributing](#contributing)
- [Support](#support)
- [License](#license)

## Installation

1 - (Install Node.js
2 - (Install MongoDB) (Or use a cloud service like MongoDB Atlas)

```shell
$ git clone git@github.com:jsolly/GeoAsteroids.git
$ cd GeoAsteroids
$ npm install
```

## Setup

```shell
$ cd /bin
# Start MongoDB Server Locally (Or use a cloud service like MongoDB Atlas)
$ ./mongod --dbpath
$ mongo # Or use a GUI like MongoDB Compass
$ use geoasteroids
$ db.createCollection("highscores")
# Check src/database.ts for connection string
$ vercel dev # Allows us to mock serverless functions locally
```

---

## Features

#### Functional

- Moving asteroids with variable jaggedness and size. Woah
- Points, lives, and levels just like you'd expect
- Spaceship with laser and thruster. Pew Pew
- Global high scoreboard so you can compete with anyone in the world!

#### Non-Functional

- Asteroid collisions detection, so you die when you're supposed to
- Static code analysis using CodeQL so the code is less likely to have security vulnerabilities
- NPM Dependency checking via Dependabot so you don't have to think about it
- 100% linted with Eslint + additional rules for a more maintainable and consistent codebase
- TypeScript under 'strict' mode with no errors, so you know we're following TS best practices
- JS bundling with Vite for a super fast front-end
- Serverless functions for API calls, so you don't have to worry too much about handling the backend
- MongoDB database for high scores cause who wants to deal with flat files?
- Custom logging library for fine-grained control of logging levels so you don't have to scratch your head about errors in production
- Over 90% test coverage so you can refactor and add features with peace of mind

## Coverage, Tests, Linting

### Coverage

```shell
npm run coverage
```

### Test

```shell
npm run test
```

### Linting (with ESlint)

```shell
npm run lint
```

---

## Contributing

Want to work on this with me? DM me on Twiiter `@_jsolly`

### Step 1

- **Option 1**

- 🍴 Fork this repo!

- **Option 2**
- 👯 Clone to your local machine using `git@github.com:jsolly/GeoAsteroids.git`

### Step 2

- **HACK AWAY!** 🔨🔨🔨

### Step 3

- 🔃 Create a new pull request using `https://github.com/jsolly/GeoAsteroids/compare`.

---

## UML Diagram

GeoAsteroids UML diagram

---

## License

[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)

- **[MIT license](http://opensource.org/licenses/mit-license.php)**