Conversation
|
Week 12 proved a difficult week for pair programming, due to technical issues etc. After trouble with sharing access to the project, commited changes wouldn't show and when we forked it again, local host crashed. Finally I forked it again Monday May 1st and pasted in everything we'd built so far and managed to open local host. Feeling satisfied I didn't give up but frustrated I didn't get further, ofc. Goes to show how much we actually learn and do each week, when a few days of miscommunication and technical trouble puts you this far behind. But still, proud of myself for not giving up and I learned a lot during the forced repetition of building the part. Looking forward to complete the project further on. |
FionaKlacar
left a comment
There was a problem hiding this comment.
I know it was a hard week for you, but great job for getting the initial part of the game set up, with the API being fetched, the username being read, and the first instruction found. You also got the restart button, Lottie and the loading to work - well done! I think once the problems with the next step of the game are worked out, you’ll be almost there for the technical part of the coding. You have a really great mindset about it all - I'm sure you'll manage to finish it soon enough. Let me know if I can help in any way!
| 'Content-Type': 'application/json' | ||
| }, | ||
| body: JSON.stringify({ | ||
| username: getState().loading.username, |
There was a problem hiding this comment.
Your console shows the problem "cannot read ‘username’"
Wondering if you could change this line to username: getState().game.username? Because ‘username’ is defined in your game reducer, not the loading reducer.
| body: JSON.stringify({ | ||
| username: getState().loading.username, | ||
| type: 'move', | ||
| direction |
There was a problem hiding this comment.
It looks like this word ‘direction’ isn’t doing anything. I think if you change line 77 it might work. OR, it might work if you take out 'type', as this isn't doing anything since it's not being passed as an argument in line 68.
| }, | ||
| body: JSON.stringify({ | ||
| username: getState().loading.username, | ||
| type: 'move', |
There was a problem hiding this comment.
I was told 'type' is the same throughout the labyrinth, so it isn't needed here. I wonder if it is doing anything though, because you haven't passed it in as an argument in line 68...
| @@ -0,0 +1,15 @@ | |||
| // import { createSlice } from '@reduxjs/toolkit' | |||
There was a problem hiding this comment.
How come you decided not to use this as a separate reducer?
| <Player | ||
| autoplay | ||
| loop | ||
| src="https://assets2.lottiefiles.com/packages/lf20_rwbbf6ns.json"> |
There was a problem hiding this comment.
Cool that you got the Lottie to work!
| <div className="game-container"> | ||
| <div className="navigation-container"> | ||
| <div className="actions-container"> | ||
| {actions.map((singleAction) => ( |
There was a problem hiding this comment.
I think singleAction should be a different colour if it is working, so perhaps something is wrong with singleAction - and that might be why your button click doesn’t load the next move….
Could it be something to do with line 7?
| placeholder="Please enter name" | ||
| value={userNameInputValue} | ||
| onChange={(event) => setUserNameInputValue(event.target.value)} /> | ||
| <button type="submit" onClick={onFormSubmit}>Start the game</button> |
There was a problem hiding this comment.
Good job with this page - you got the game to start after entering a username!
| dispatch(actionsGame(direction)) | ||
| } | ||
|
|
||
| const onRestartBtnClick = () => { |
No description provided.