Skip to content

Commit

Permalink
πŸ”€ Merge pull request #33 from alexlee-dev/develop
Browse files Browse the repository at this point in the history
v0.1.0 - πŸ’°- Economy
  • Loading branch information
Alex Lee committed Aug 21, 2019
2 parents 6b341d5 + b516831 commit 22cf57c
Show file tree
Hide file tree
Showing 33 changed files with 23,893 additions and 22,582 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ node_js:
- 'node'
script:
- yarn build
- yarn coveralls
- yarn test:coveralls
51 changes: 49 additions & 2 deletions README.md
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
Binary file added hermes-cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions hermes-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions hermes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 33 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
{
"name": "hermes",
"version": "0.1.0",
"private": true,
"name": "hermes-game",
"version": "0.0.0",
"description": "A game about space and junk.",
"repository": {
"type": "git",
"url": "git+https://github.com/alexlee-dev/hermes.git"
},
"keywords": [
"hermes",
"game",
"space",
"eve",
"economy"
],
"author": "Alex Lee <alex@alexlee.site>",
"bugs": {
"url": "https://github.com/alexlee-dev/hermes/issues"
},
"homepage": "https://github.com/alexlee-dev/hermes#readme",
"dependencies": {
"@sentry/browser": "^5.6.1",
"grommet": "^2.7.6",
"grommet-icons": "^4.3.0",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-redux": "^7.1.0",
"react-scripts": "3.1.0",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
"redux-thunk": "^2.3.0",
"styled-components": "^4.3.2",
"uuid": "^3.3.3"
},
"devDependencies": {
"coveralls": "^3.0.6",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"coveralls": "echo Setup Coveralls."
"test": "react-scripts test",
"test:coveralls": "jest --coverage --collectCoverageFrom=src/**/* --coverageReporters=text-lcov | coveralls"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Hermes",
"name": "Hermes",
"icons": [
{
"src": "favicon.ico",
Expand All @@ -20,6 +20,6 @@
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"theme_color": "#a618c2",
"background_color": "#ffffff"
}
69 changes: 54 additions & 15 deletions src/App.js
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)
Loading

0 comments on commit 22cf57c

Please sign in to comment.