Implemented Markdown panel, wrote an update
This commit is contained in:
@@ -0,0 +1,63 @@
|
|||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
Instructions
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
This is a resource accumulation game, with some similarities to idle games. The idea is that you recruit new units once per day, train them as soldiers, and send them to attack other players. You can also train spies and scientists, which each grant their own benefits.
|
||||||
|
|
||||||
|
The goal of the game is to be at the top of the game ladder for as long as possible.
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
### Recruits
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
Untrained recruits gain you 1 gold piece evey half hour - the only unit type that grants a passive income. They also act as a defense force when your soldiers are away, but they have lower combat skills. When recriuts are attacked, it is marked as "undefended" in the combat log. Recruits can still use equipment.
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
### Soldiers
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
Soldiers are your bread and butter unit in this game. They are experts at combat, and as such are much stronger than recruits. They are used to raid other player's kingdoms for gold, but larger attack forces tend to suffer casualties due to battle. Combat takes time - 1 minute for every soldier that you have. During combat, soldiers will not be available to defend your kingdom. They also use any equipment that you've purchased.
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
### Scientists
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
Scientists don't fight. Instead, they offer other means of gaining advantage over other players, such as granting access to equipment. Equipment such as weapons boost and attacking force's strength, while armour boosts the defending force. Consumables are also usable by both attackers and defenders.
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
### Spies
|
||||||
|
|
||||||
|
<div class="break" />
|
||||||
|
|
||||||
|
--Coming Soon--
|
||||||
|
|
||||||
@@ -2,6 +2,7 @@ Major
|
|||||||
---
|
---
|
||||||
|
|
||||||
* Implement spies.
|
* Implement spies.
|
||||||
|
* Write the instructions for spies.
|
||||||
* Write game instructions on profile page.
|
* Write game instructions on profile page.
|
||||||
* Implement countdown timers for combat and training.
|
* Implement countdown timers for combat and training.
|
||||||
|
|
||||||
@@ -18,6 +19,11 @@ Patch
|
|||||||
* Game Balance.
|
* Game Balance.
|
||||||
* Images to social media instead of links.
|
* Images to social media instead of links.
|
||||||
|
|
||||||
|
Potential And Confirmed Bugs
|
||||||
|
---
|
||||||
|
|
||||||
|
* What happens to consumables when recruits are attacked?
|
||||||
|
|
||||||
Wishlist
|
Wishlist
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
So Stylish, Darling!
|
||||||
|
---
|
||||||
|
_3 June 2019_
|
||||||
|
|
||||||
|
I began today working on some styling - you'll notice it most in the [game ladder](/ladder), [combat logs](/combatlog) and [equipment page](/equipment). I've also removed these from the [task list](/tasklist). I'm paying special attention to the mobile (cell phone) layout, since at least 10% of players use mobiles to play.
|
||||||
|
|
||||||
|
I've also written some basic instructions for using each of the existing unit types (spies will come soon). I'll eventually add more to it as I implement new features.
|
||||||
|
|
||||||
|
I'm wondering what sort of events I could host using as minimal coding as possible. Badges could serve for capture the flag... what else? I'm open to feedback - tweet me or join my discord and let me know!
|
||||||
|
|
||||||
@@ -46,6 +46,12 @@ h2 {
|
|||||||
color: lightblue;
|
color: lightblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 12pt;
|
||||||
|
font-weight: bold;
|
||||||
|
color: pink;
|
||||||
|
}
|
||||||
|
|
||||||
br {
|
br {
|
||||||
padding-bottom: .5em;
|
padding-bottom: .5em;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ const runCombatTick = (connection) => {
|
|||||||
defendingUnits = results[0].soldiers;
|
defendingUnits = results[0].soldiers;
|
||||||
} else {
|
} else {
|
||||||
defendingUnits = results[0].recruits;
|
defendingUnits = results[0].recruits;
|
||||||
|
undefended = true; //recruits only
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the attacker equipment
|
//get the attacker equipment
|
||||||
|
|||||||
@@ -3,16 +3,14 @@ import ReactMarkdown from 'react-markdown/with-html';
|
|||||||
|
|
||||||
//panels
|
//panels
|
||||||
import CommonLinks from '../panels/common_links.jsx';
|
import CommonLinks from '../panels/common_links.jsx';
|
||||||
|
import Markdown from '../panels/markdown.jsx';
|
||||||
|
|
||||||
class PatronList extends React.Component {
|
class PatronList extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
data: '',
|
|
||||||
warning: ''
|
warning: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendRequest('/content/patron_list.md');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -34,33 +32,13 @@ class PatronList extends React.Component {
|
|||||||
|
|
||||||
<h1 className='centered'>My Patrons On Patreon</h1>
|
<h1 className='centered'>My Patrons On Patreon</h1>
|
||||||
<p className='centered'>You can become a patron <a href='https://www.patreon.com/krgamestudios'>here</a>.</p>
|
<p className='centered'>You can become a patron <a href='https://www.patreon.com/krgamestudios'>here</a>.</p>
|
||||||
{this.state ? <ReactMarkdown source={this.state.data} escapeHtml={false} /> : <p>Loading patron list...</p>}
|
<Markdown url='/content/patron_list.md' setWarning={this.setWarning.bind(this)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendRequest(url, args = {}) {
|
|
||||||
//build the XHR
|
|
||||||
let xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', url, true);
|
|
||||||
|
|
||||||
xhr.onreadystatechange = () => {
|
|
||||||
if (xhr.readyState === 4) {
|
|
||||||
if (xhr.status === 200) {
|
|
||||||
//on success
|
|
||||||
this.setState({ data: xhr.responseText });
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.setWarning(xhr.responseText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
xhr.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
setWarning(s) {
|
setWarning(s) {
|
||||||
this.setState({ warning: s });
|
this.setState({ warning: s });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { storeProfile, clearProfile } from '../../actions/profile.js';
|
|||||||
//panels
|
//panels
|
||||||
import CommonLinks from '../panels/common_links.jsx';
|
import CommonLinks from '../panels/common_links.jsx';
|
||||||
import AttackButton from '../panels/attack_button.jsx';
|
import AttackButton from '../panels/attack_button.jsx';
|
||||||
|
import Markdown from '../panels/markdown.jsx';
|
||||||
|
|
||||||
class Profile extends React.Component {
|
class Profile extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -163,14 +164,6 @@ class Profile extends React.Component {
|
|||||||
<button className='col' onClick={ () => this.sendRequest('/untrainrequest', {role: 'soldier'}) }>Untrain Soldier</button>
|
<button className='col' onClick={ () => this.sendRequest('/untrainrequest', {role: 'soldier'}) }>Untrain Soldier</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='row'>
|
|
||||||
<p className='col'>Spies:</p>
|
|
||||||
<p className='col'>{this.props.profile.spies}</p>
|
|
||||||
|
|
||||||
<button className='col' onClick={ () => this.sendRequest('/trainrequest', {role: 'spy'}) }>Train Spy (200 gold)</button>
|
|
||||||
<button className='col' onClick={ () => this.sendRequest('/untrainrequest', {role: 'spy'}) }>Untrain Spy</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<p className='col'>Scientists:</p>
|
<p className='col'>Scientists:</p>
|
||||||
<p className='col'>{this.props.profile.scientists}</p>
|
<p className='col'>{this.props.profile.scientists}</p>
|
||||||
@@ -178,7 +171,19 @@ class Profile extends React.Component {
|
|||||||
<button className='col' onClick={ () => this.sendRequest('/trainrequest', {role: 'scientist'}) }>Train Scientist (120 gold)</button>
|
<button className='col' onClick={ () => this.sendRequest('/trainrequest', {role: 'scientist'}) }>Train Scientist (120 gold)</button>
|
||||||
<button className='col' onClick={ () => this.sendRequest('/untrainrequest', {role: 'scientist'}) }>Untrain Scientist</button>
|
<button className='col' onClick={ () => this.sendRequest('/untrainrequest', {role: 'scientist'}) }>Untrain Scientist</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className='row'>
|
||||||
|
<p className='col'>Spies:</p>
|
||||||
|
<p className='col'>{this.props.profile.spies}</p>
|
||||||
|
|
||||||
|
<button className='col' onClick={ () => this.sendRequest('/trainrequest', {role: 'spy'}) }>Train Spy (200 gold)</button>
|
||||||
|
<button className='col' onClick={ () => this.sendRequest('/untrainrequest', {role: 'spy'}) }>Untrain Spy</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className='break' />
|
||||||
|
|
||||||
|
<Markdown url='/content/instructions.md' setWarning={this.setWarning.bind(this)} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -241,16 +246,16 @@ class Profile extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<p className='col'>Spies:</p>
|
<p className='col'>Scientists:</p>
|
||||||
<p className='col'>{this.props.profile.spies}</p>
|
<p className='col'>{this.props.profile.scientists}</p>
|
||||||
|
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<p className='col'>Scientists:</p>
|
<p className='col'>Spies:</p>
|
||||||
<p className='col'>{this.props.profile.scientists}</p>
|
<p className='col'>{this.props.profile.spies}</p>
|
||||||
|
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
@@ -306,16 +311,16 @@ class Profile extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<p className='col'>Spies:</p>
|
<p className='col'>Scientists:</p>
|
||||||
<p className='col'>{this.props.profile.spies}</p>
|
<p className='col'>{this.props.profile.scientists}</p>
|
||||||
|
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<p className='col'>Scientists:</p>
|
<p className='col'>Spies:</p>
|
||||||
<p className='col'>{this.props.profile.scientists}</p>
|
<p className='col'>{this.props.profile.spies}</p>
|
||||||
|
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
<div className='col' />
|
<div className='col' />
|
||||||
|
|||||||
@@ -3,16 +3,14 @@ import ReactMarkdown from 'react-markdown/with-html';
|
|||||||
|
|
||||||
//panels
|
//panels
|
||||||
import CommonLinks from '../panels/common_links.jsx';
|
import CommonLinks from '../panels/common_links.jsx';
|
||||||
|
import Markdown from '../panels/markdown.jsx';
|
||||||
|
|
||||||
class TaskList extends React.Component {
|
class TaskList extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
data: '',
|
|
||||||
warning: ''
|
warning: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendRequest('/content/task_list.md');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -33,33 +31,13 @@ class TaskList extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 className='centered'>Kingdom Battles Developer Task List</h1>
|
<h1 className='centered'>Kingdom Battles Developer Task List</h1>
|
||||||
{this.state ? <ReactMarkdown source={this.state.data} escapeHtml={false} /> : <p>Loading task list...</p>}
|
<Markdown url='/content/task_list.md' setWarning={this.setWarning.bind(this)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendRequest(url, args = {}) {
|
|
||||||
//build the XHR
|
|
||||||
let xhr = new XMLHttpRequest();
|
|
||||||
xhr.open('GET', url, true);
|
|
||||||
|
|
||||||
xhr.onreadystatechange = () => {
|
|
||||||
if (xhr.readyState === 4) {
|
|
||||||
if (xhr.status === 200) {
|
|
||||||
//on success
|
|
||||||
this.setState({ data: xhr.responseText });
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.setWarning(xhr.responseText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
xhr.send();
|
|
||||||
}
|
|
||||||
|
|
||||||
setWarning(s) {
|
setWarning(s) {
|
||||||
this.setState({ warning: s });
|
this.setState({ warning: s });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ export default class Blurb extends React.Component {
|
|||||||
<p className='centered'><em>A game in early development.</em></p>
|
<p className='centered'><em>A game in early development.</em></p>
|
||||||
<br />
|
<br />
|
||||||
<p>This is a resource accumulation game, with some similarities to idle games. The idea is that you recruit new units once per day, train them as soldiers, and send them to attack other players. You can also train spies and scientists, which each grant their own benefits.</p>
|
<p>This is a resource accumulation game, with some similarities to idle games. The idea is that you recruit new units once per day, train them as soldiers, and send them to attack other players. You can also train spies and scientists, which each grant their own benefits.</p>
|
||||||
<p>Untrained recruits gain you 1 gold piece evey half hour - the only unit type that grants a passive income.</p>
|
|
||||||
<p>You can follow the developer KR Game Studios here:</p>
|
<p>You can follow the developer KR Game Studios here:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to='https://facebook.com/KRGameStudios' /></li>
|
<li><Link to='https://facebook.com/KRGameStudios' /></li>
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
|
||||||
|
class Markdown extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
if (this.props.source) {
|
||||||
|
this.state = {
|
||||||
|
data: this.props.source
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
this.state = {
|
||||||
|
data: ''
|
||||||
|
};
|
||||||
|
this.sendRequest(props.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (this.state) {
|
||||||
|
return (<ReactMarkdown source={this.state.data} escapeHtml={false} />);
|
||||||
|
} else {
|
||||||
|
return (<p className='centered'>Loading markdown...</p>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendRequest(url, args = {}) {
|
||||||
|
//build the XHR
|
||||||
|
let xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('GET', url, true);
|
||||||
|
|
||||||
|
xhr.onreadystatechange = () => {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
//on success
|
||||||
|
this.setState({ data: xhr.responseText });
|
||||||
|
}
|
||||||
|
else if (this.props.setWarning) {
|
||||||
|
this.props.setWarning(xhr.responseText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Markdown.propTypes = {
|
||||||
|
source: PropTypes.string,
|
||||||
|
url: PropTypes.string,
|
||||||
|
setWarning: PropTypes.func
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Markdown;
|
||||||
Reference in New Issue
Block a user