-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Merge pull request #33 from alexlee-dev/develop
v0.1.0 - π°- Economy
- Loading branch information
Showing
33 changed files
with
23,893 additions
and
22,582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ node_js: | |
- 'node' | ||
script: | ||
- yarn build | ||
- yarn coveralls | ||
- yarn test:coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# Hermes | ||
A game like Eve. But not. | ||
<p align="center"> | ||
<a href="" rel="noopener"> | ||
<img width=875px height=350px src="https://github.com/alexlee-dev/hermes/raw/develop/hermes-cover.png" alt="Hermes logo"></a> | ||
</p> | ||
|
||
<div align="center"> | ||
|
||
[![Build Status][travis]][travis] | ||
|
||
</div> | ||
|
||
--- | ||
|
||
<p align="center"> A game about space and junk. | ||
<br> | ||
</p> | ||
|
||
## π Table of Contents | ||
|
||
- [About](#about) | ||
- [Built Using](#built_using) | ||
- [Authors](#authors) | ||
- [Acknowledgments](#acknowledgement) | ||
|
||
## π§ About <a name = "about"></a> | ||
|
||
A game about space and junk. | ||
|
||
## βοΈ Built Using <a name = "built_using"></a> | ||
|
||
- [React](https://reactjs.org/) - A JavaScript library for building user interfaces | ||
- [Redux](https://redux.js.org/) - A predictable state container for JavaScript apps | ||
- [Grommet](https://v2.grommet.io/) - A React-based UI Framework | ||
|
||
## βοΈ Authors <a name = "authors"></a> | ||
|
||
- [@alexlee-dev](https://github.com/alexlee-dev) - Developer | ||
|
||
## π Acknowledgements <a name = "acknowledgement"></a> | ||
|
||
- [NameCheap's Logo Maker](https://www.namecheap.com/logo-maker/app/new) | ||
|
||
[npm-image]: https://img.shields.io/npm/v/hermes-game.svg | ||
[npm-downloads]: https://img.shields.io/npm/dt/hermes-gaame.svg | ||
[npm-url]: https://www.npmjs.com/package/hermes-gaame | ||
[size-image]: https://img.shields.io/bundlephobia/minzip/hermes-game.svg | ||
[coverage-badge]: https://coveralls.io/repos/github/alexlee-dev/hermes/badge.svg?branch=master | ||
[coverage-link]: https://coveralls.io/github/alexlee-dev/hermes?branch=master | ||
[travis]: https://travis-ci.org/alexlee-dev/hermes.svg?branch=master |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,72 @@ | ||
import React, { useEffect } from 'react' | ||
import PropTypes from 'prop-types' | ||
import { connect } from 'react-redux' | ||
import { generatePlanet } from './util' | ||
import { generatePlanets } from './util' | ||
import { setPlanets } from './redux/actions/world' | ||
import ItemTimer from './components/ItemTimer' | ||
import View from './views/View' | ||
import ViewSelector from './components/ViewSelector' | ||
import { setShipLocationValue, setShipLocationName } from './redux/actions/ship' | ||
|
||
const App = ({ dispatch, world }) => { | ||
const App = ({ | ||
handleInitializeShipLocation, | ||
handleSetPlanets, | ||
planets, | ||
userCash | ||
}) => { | ||
useEffect(() => { | ||
generatePlanet(dispatch) | ||
generatePlanet(dispatch) | ||
generatePlanet(dispatch) | ||
if (planets.length === 0) { | ||
const planets = generatePlanets() | ||
|
||
handleSetPlanets(planets) | ||
|
||
const homePlanet = planets.find(planet => planet.isHomePlanet === true) | ||
|
||
const value = homePlanet.location | ||
const name = homePlanet.name | ||
|
||
handleInitializeShipLocation(value, name) | ||
} | ||
|
||
// eslint-disable-next-line | ||
}, []) | ||
|
||
const { planets } = world | ||
|
||
return ( | ||
<div> | ||
<h1>hermes</h1> | ||
<ItemTimer /> | ||
<h2>Cash:</h2> | ||
<span>{userCash}</span> | ||
<br /> | ||
<br /> | ||
<ViewSelector /> | ||
<div> | ||
{planets.map(({ items, name }) => ( | ||
<div> | ||
<p>{name}</p> | ||
<p>Items: {JSON.stringify(items, null, 2)}</p> | ||
</div> | ||
))} | ||
<View /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
const mapStateToProps = ({ world }) => ({ world }) | ||
App.propTypes = { | ||
handleInitializeShipLocation: PropTypes.func.isRequired, | ||
handleSetPlanets: PropTypes.func.isRequired, | ||
planets: PropTypes.array.isRequired | ||
} | ||
|
||
const mapStateToProps = ({ user, world }) => ({ | ||
planets: world.planets, | ||
userCash: user.cash | ||
}) | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
handleSetPlanets: planets => dispatch(setPlanets(planets)), | ||
handleInitializeShipLocation: (value, name) => { | ||
dispatch(setShipLocationValue(value)) | ||
dispatch(setShipLocationName(name)) | ||
} | ||
}) | ||
|
||
export default connect(mapStateToProps)(App) | ||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(App) |
Oops, something went wrong.