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

https://github.com/clemix37/chrono-cosmos

đŸ•šī¸ Idle Web game about traveling through space & time 🚀
https://github.com/clemix37/chrono-cosmos

game-development javascript javascript-game typescript typescript-game

Last synced: about 1 month ago
JSON representation

đŸ•šī¸ Idle Web game about traveling through space & time 🚀

Awesome Lists containing this project

README

          

![Version](https://img.shields.io/badge/version-v0.5--alpha-purple)
![License](https://img.shields.io/github/license/Clemix37/chrono-cosmos)
![Build](https://img.shields.io/badge/build-passing-brightgreen)
![Made with](https://img.shields.io/badge/made%20with-TypeScript-blue)
![Contributions](https://img.shields.io/badge/contributions-welcome-orange)
![GitHub Repo stars](https://img.shields.io/github/stars/Clemix37/chrono-cosmos?style=social)
![Tests](https://github.com/Clemix37/chrono-cosmos/actions/workflows/tests.yml/badge.svg)

# ChronoCosmos

đŸ•šī¸ Idle Web game about traveling through space & time 🚀
![ChronoCosmos](https://github.com/Clemix37/chrono-cosmos/blob/main/img/chrono_cosmos_v0.5.png?raw=true)

## History

You are Jack, a time-traveler and space explorer. Your main objective is to restore life on this planet, that once was destroyed because of Humans' space programs.
Take great care, you could die outside of your base ...

## Game loop

Collect energy => Buy / upgrade components => unlock resources => travel further => upgrade spaceship => repeat

## Design

This was the desirable design (Generated by ChatGPT v3):
![ChronoCosmos](https://github.com/Clemix37/chrono-cosmos/blob/main/img/maquette_dall_e_chatgpt.png?raw=true)

## Development

Selection of the character is still in development.
You enter the game by selecting a player and its statistics.

## Tests

### Formulas

`toDecimal` should round a decimal to the number of decimals given in arguments, by default 2
Ex:

- `toDecimal(2.4156844)` => `2.42`
- `toDecimal(2.4136844)` => `2.41`
- `toDecimal(2.4156844, 3)` => `2.416`
- `toDecimal(2.4136844, 3)` => `2.414`
- `toDecimal(2.4156844, 4)` => `2.4157`
- `toDecimal(2.4136844, 4)` => `2.4137`

`formatEnergy` should format the energy based on the number itself
Ex:

- `formatEnergy(0)` => `0`
- `formatEnergy(1)` => `1`
- `formatEnergy(100)` => `100`
- `formatEnergy(999)` => `999`
- `formatEnergy(1e3)` => `1K`
- `formatEnergy(1e4)` => `10K`
- `formatEnergy(999999)` => `999.999K`
- `formatEnergy(1e7)` => `10M`
- `formatEnergy(1e10)` => `10B`

### Data

`getRandomFromArray` should return random defined element from array
`generateRandomId` should return a random id based on current date for uniqueness

### Config

`getDefaultConfig` should return the default config without player's name, level to 0 and the status "not started"

### Character

`Character` should be a class containing id, name, age, speed, intelligence, strength properties and should return a template with `getDisplayTemplate`
`generateRandomStat` should return random stats between max and minimum of each statistic
`generateThreeRandomCharacters` should create three different characters, return an array containing the three and each one having different values
`getCharacterGeneratedById` should get the character created with this id and return it

### Game Content

`upgrade` should add a level to the current one, and update the upgrade cost

## Installation

```bash
git clone https://github.com/Clemix37/chrono-cosmos.git
cd chrono-cosmos
npm install # install dependencies
npm run build # build typescript files
npm run dev # launch live-server on index.html file
```

## Roadmap

- [x] First UI design
- [x] Create a GameStateManager
- [x] Create a ScreenManager
- [x] Create a DisplayManager
- [x] Add tests for formulas, data and config
- [x] Add tests for game state
- [x] Remake the UI of character selection
- [ ] Change persistence data inside localstorage using string (like [Cookie Clicker](https://orteil.dashnet.org/cookieclicker/))
- [ ] Add more components / resources (maybe through AI for infinite ideas ?)
- [ ] Random events like meteorites or anomalies
- [ ] Add animations

## Contributing

PRs welcome !
If necessary, create issues for ideas, bugs etc.

## License

[MIT](https://choosealicense.com/licenses/mit/) âœ