-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
106 changed files
with
5,415 additions
and
2,302 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,6 @@ | ||
Crafting: | ||
|
||
- craefter can die from crafting | ||
- player can die on slaying tbd | ||
- items can be w:rusty / a:stiff / j:dull | ||
- mysterious items can be crafted but not sure about the outcome |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,16 @@ | ||
import React, {Component} from 'react'; | ||
|
||
export default class About extends Component { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
hello world | ||
|
||
<div> | ||
<a href='/'>back</a> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,68 @@ | ||
* { | ||
font-family: 'MedievalSharp', cursive; | ||
font-size: 24px; | ||
} | ||
|
||
html, body { | ||
color: #FAEBD7; | ||
background-color: #000; | ||
} | ||
|
||
strong { | ||
color: #FAEFE1; | ||
} | ||
|
||
.craeft-logo { | ||
font-size: 90px; | ||
font-weight: bold; | ||
color: #FAEFE1; | ||
} | ||
|
||
.column { | ||
display: inline-block; | ||
vertical-align: top; | ||
padding-right: 20px; | ||
} | ||
|
||
.frame { | ||
min-width: 380px; | ||
} | ||
|
||
.row { | ||
text-align: center; | ||
} | ||
|
||
.player { | ||
margin-bottom: 30px; | ||
} | ||
|
||
.item, | ||
.resources, | ||
.craefter, | ||
.craeft-window, | ||
.craefter-window { | ||
border: 1px solid #FAEFE1; | ||
margin-bottom: 5px; | ||
margin-top: 2px; | ||
padding: 6px; | ||
} | ||
|
||
.craefters-list { | ||
margin-top: 5px; | ||
} | ||
|
||
.items hr, | ||
.craefters hr, | ||
.farm hr { | ||
margin-top: 10px; | ||
margin-bottom: 0; | ||
} | ||
|
||
.footer { | ||
text-align: center; | ||
background-color: #000; | ||
} | ||
|
||
.item-description { | ||
min-width: 80%; | ||
} |
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,127 @@ | ||
import React, {Component} from 'react'; | ||
// game engine | ||
import Player from './engine/player'; | ||
import Farm from "./engine/farm"; | ||
|
||
// visual components | ||
// structure | ||
import Footer from './components/structure/Footer'; | ||
import Header from "./components/structure/Header"; | ||
|
||
// game | ||
import PlayerComponent from './components/Player' | ||
import FarmComponent from "./components/Farm"; | ||
import ItemsComponent from "./components/Items"; | ||
import CraeftersComponent from "./components/Craefters"; | ||
|
||
const initialResources = 100; | ||
|
||
export default class Craeft extends Component { | ||
|
||
state = { | ||
// the player | ||
player: new Player(), | ||
// the farm | ||
farm: new Farm(10), | ||
// craefters | ||
craefters: [], | ||
// items | ||
items: [], | ||
// resources | ||
resources: { | ||
wood: initialResources, | ||
metal: initialResources, | ||
cloth: initialResources, | ||
diamond: initialResources | ||
} | ||
}; | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
// re-render every second | ||
setInterval(() => { | ||
this.forceUpdate(); | ||
}, 1 * 1000); | ||
|
||
this.farmComplete = this.farmComplete.bind(this); | ||
this.addCraefter = this.addCraefter.bind(this); | ||
this.addItem = this.addItem.bind(this); | ||
} | ||
|
||
farmComplete( | ||
result | ||
) { | ||
const resources = Object.assign({}, this.state.resources); | ||
|
||
resources.metal += result.metal; | ||
resources.wood += result.wood; | ||
resources.cloth += result.cloth; | ||
resources.diamond += result.diamond; | ||
|
||
this.setState({ | ||
resources | ||
}) | ||
} | ||
|
||
addCraefter( | ||
craefter | ||
) { | ||
const craefters = [...this.state.craefters]; | ||
|
||
craefters.push(craefter); | ||
|
||
this.setState({ | ||
craefters | ||
}) | ||
} | ||
|
||
addItem( | ||
item, | ||
resourcesConsumed | ||
) { | ||
const items = [...this.state.items]; | ||
const resources = Object.assign({}, this.state.resources); | ||
|
||
resources.wood -= resourcesConsumed.wood; | ||
resources.metal -= resourcesConsumed.metal; | ||
resources.cloth -= resourcesConsumed.cloth; | ||
resources.diamond -= resourcesConsumed.diamond; | ||
|
||
items.push(item); | ||
|
||
this.setState({ | ||
items, | ||
resources | ||
}) | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="rpgui-content container craeft"> | ||
|
||
<Header/> | ||
|
||
<PlayerComponent player={this.state.player}/> | ||
|
||
<div className={'craefting-interface columns'}> | ||
|
||
<CraeftersComponent resources={this.state.resources} | ||
craefters={this.state.craefters} | ||
craefterAdded={this.addCraefter} | ||
itemAdded={this.addItem}/> | ||
|
||
<FarmComponent resources={this.state.resources} | ||
farm={this.state.farm} | ||
farmComplete={this.farmComplete}/> | ||
|
||
<ItemsComponent items={this.state.items}/> | ||
|
||
</div> | ||
|
||
<Footer/> | ||
|
||
</div> | ||
); | ||
} | ||
} |
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,9 +1,10 @@ | ||
/* globals describe, it */ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from '../src/App'; | ||
import Craeft from '../App'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<App />, div); | ||
ReactDOM.render(<Craeft />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
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.
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.
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.
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.
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.
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.
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.
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.
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.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.