diff --git a/public/images/chicky.png b/public/images/chicky.png
index bf7e77c..7697011 100644
Binary files a/public/images/chicky.png and b/public/images/chicky.png differ
diff --git a/public/images/foxy.png b/public/images/foxy.png
index ff2cc05..b3e1280 100644
Binary files a/public/images/foxy.png and b/public/images/foxy.png differ
diff --git a/public/images/goal.png b/public/images/goal.png
new file mode 100644
index 0000000..31ced24
Binary files /dev/null and b/public/images/goal.png differ
diff --git a/public/images/layout.png b/public/images/layout.png
index 574e596..f1711ec 100644
Binary files a/public/images/layout.png and b/public/images/layout.png differ
diff --git a/src/Component/Board/Board.js b/src/Component/Board/Board.js
index 895c6fd..a47a111 100644
--- a/src/Component/Board/Board.js
+++ b/src/Component/Board/Board.js
@@ -1,6 +1,7 @@
import React from 'react'
import './Board.scss'
import Character from './../Character'
+import { isGoal } from './../../Util'
// Board :: Props -> React.Component
export default ({
@@ -17,7 +18,9 @@ export default ({
// Tile :: Props -> React.Component
const Tile = ({
char,
+ x,
+ y,
}) =>
- {char && }
+ {char && }
diff --git a/src/Component/Board/__snapshots__/Board.spec.js.snap b/src/Component/Board/__snapshots__/Board.spec.js.snap
index fc521ff..3b816b6 100644
--- a/src/Component/Board/__snapshots__/Board.spec.js.snap
+++ b/src/Component/Board/__snapshots__/Board.spec.js.snap
@@ -14,7 +14,7 @@ exports[`Component/Board renders a board with an empty tile and a tile with a ch
data-is="tile"
>
diff --git a/src/Component/Character/Character.js b/src/Component/Character/Character.js
index 28f67a8..f8f0545 100644
--- a/src/Component/Character/Character.js
+++ b/src/Component/Character/Character.js
@@ -3,11 +3,12 @@ import './Character.scss'
// Character :: Props -> React.Component
export default ({
+ asset,
direction,
- asset
+ isBurrowed,
}) =>
diff --git a/src/Component/Character/Character.scss b/src/Component/Character/Character.scss
index a771fe7..6489962 100644
--- a/src/Component/Character/Character.scss
+++ b/src/Component/Character/Character.scss
@@ -12,17 +12,37 @@ div[data-is="character"] {
&.up {
background-position-x: 0px;
+
+ &.is-burrowed {
+ background-position-x: -512px;
+ }
}
&.down {
background-position-x: -384px;
+
+ &.is-burrowed {
+ background-position-x: -896px;
+ }
}
&.left {
background-position-x: -256px;
+
+ &.is-burrowed {
+ background-position-x: -768px;
+ }
}
&.right {
background-position-x: -128px;
+
+ &.is-burrowed {
+ background-position-x: -640px;
+ }
+ }
+
+ &.burrow {
+ background-position-x: -512px;
}
}
diff --git a/src/Component/Character/Character.spec.js b/src/Component/Character/Character.spec.js
index 385cd7f..584c28b 100644
--- a/src/Component/Character/Character.spec.js
+++ b/src/Component/Character/Character.spec.js
@@ -4,8 +4,26 @@ import Character from './Character'
describe('Component/Character', () => {
it('renders a character component', () => {
+ const state = {
+ direction: 'up',
+ asset: 'fox',
+ isBurrowed: false,
+ }
+
+ expect(
+ renderer.create( )
+ ).toMatchSnapshot()
+ })
+
+ it('renders a burrowed character component', () => {
+ const state = {
+ direction: 'down',
+ asset: 'chick',
+ isBurrowed: true,
+ }
+
expect(
- renderer.create( )
+ renderer.create( )
).toMatchSnapshot()
})
})
diff --git a/src/Component/Character/__snapshots__/Character.spec.js.snap b/src/Component/Character/__snapshots__/Character.spec.js.snap
index 4f1562a..59d0403 100644
--- a/src/Component/Character/__snapshots__/Character.spec.js.snap
+++ b/src/Component/Character/__snapshots__/Character.spec.js.snap
@@ -1,8 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`Component/Character renders a burrowed character component 1`] = `
+
+`;
+
exports[`Component/Character renders a character component 1`] = `
`;
diff --git a/src/Component/Game/Game.scss b/src/Component/Game/Game.scss
index d136066..447772b 100644
--- a/src/Component/Game/Game.scss
+++ b/src/Component/Game/Game.scss
@@ -3,8 +3,8 @@
div[data-is="game"] {
display: flex;
flex-direction: row;
- transform: scale(.8);
- margin-top: -2rem;
+ transform: scale(.75);
+ margin-top: -4rem;
section.game-section {
flex: 1;
diff --git a/src/Component/RightPanel/RightPanel.js b/src/Component/RightPanel/RightPanel.js
index b97d604..4e98c78 100644
--- a/src/Component/RightPanel/RightPanel.js
+++ b/src/Component/RightPanel/RightPanel.js
@@ -17,12 +17,17 @@ export default ({
!
- Il va falloir survivre en faisant tomber les renards
+ Fais tomber les renards
dans leurs terriers
grâce aux flèches de
ton clavier.
- Mais prend garde à ne pas te faire manger !
+
+ Pour réussir, les deux renards
+ doivent être dans leurs
+ terriers en même temps !
+
+ Prends bien garde à ne pas te faire manger ou tu devras recommencer !
>
}
diff --git a/src/Component/RightPanel/__snapshots__/RightPanel.spec.js.snap b/src/Component/RightPanel/__snapshots__/RightPanel.spec.js.snap
index 6d97660..90bbe43 100644
--- a/src/Component/RightPanel/__snapshots__/RightPanel.spec.js.snap
+++ b/src/Component/RightPanel/__snapshots__/RightPanel.spec.js.snap
@@ -37,7 +37,7 @@ exports[`Component/RightPanel renders the welcome message when the game is neith
!
- Il va falloir survivre en faisant tomber les renards
+ Fais tomber les renards
- Mais prend garde à ne pas te faire manger !
+ Pour réussir, les deux renards
+
+ doivent être dans leurs terriers
+
+ en même temps !
+
+
+ Prends bien garde à ne pas te faire manger où tu devra reccomencer !
prop(direction, {
right: 'left',
left: 'right',
})
+
+// isGoal :: (Number, Number) -> Boolean
+export const isGoal = (x , y) => y === 4 && (x === 1 || x === 3)