You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
780 B
37 lines
780 B
var React = require('react');
|
|
var Input = require('./Input');
|
|
|
|
require('../sass/character.scss');
|
|
|
|
var character = React.createClass({
|
|
getInitialState: function() {
|
|
return {
|
|
active: true,
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
},
|
|
|
|
move: function(x, y) {
|
|
|
|
},
|
|
|
|
//componentWillUpdate(object nextProps, object nextState)
|
|
//componentDidUpdate(object prevProps, object prevState)
|
|
|
|
render: function() {
|
|
var classname = ['ourhero', 'x' + this.state.x, 'y' + this.state.y];
|
|
|
|
if (this.state.active === true) {
|
|
classname.push('active');
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<div className={classname.join(' ')}></div>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
module.exports = character;
|
|
|