Skip to content

Commit 5db1925

Browse files
committed
refactor: make jump more obvious
1 parent b12a71c commit 5db1925

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

client/components/Robot.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import WinContainer from '../containers/WinContainer'
44
import classNames from 'classnames'
55
import { JUMP_UP, MOVE_FORWARD, SOUND, TOGGLE_SOUND, TURN_LEFT, TURN_RIGHT } from '../reducers/action'
66

7+
const defaultScale = 85;
78
class Robot extends Component {
89
constructor (props) {
910
super(props)
1011
this.state = {
11-
scale: 90,
12+
scale: defaultScale,
1213
}
1314
}
1415

@@ -31,7 +32,7 @@ class Robot extends Component {
3132

3233
/** Set scale based on robot props */
3334
componentDidUpdate (_prevProps) {
34-
const defaultScale = 90;
35+
const onBoxScale = 115;
3536
if (!this.props.robot.isAlive) {
3637
if (this.state.scale !== 10) {
3738
this.setState({ scale: 10 })
@@ -41,8 +42,8 @@ class Robot extends Component {
4142
const commandExecuted = this.props.commandQueue[this.props.executeCommandIndex - 1]
4243
switch (commandExecuted) {
4344
case JUMP_UP:
44-
if (this.state.scale !== 110) {
45-
this.setState({ scale: 110 })
45+
if (this.state.scale !== onBoxScale) {
46+
this.setState({ scale: onBoxScale })
4647
}
4748
break;
4849
case MOVE_FORWARD:

0 commit comments

Comments
 (0)