Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Labyrinth #216

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

LinaAdamsson
Copy link

No description provided.

@LinaAdamsson
Copy link
Author

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.

Copy link

@FionaKlacar FionaKlacar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you decided not to use this as a separate reducer?

<Player
autoplay
loop
src="https://assets2.lottiefiles.com/packages/lf20_rwbbf6ns.json">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool that you got the Lottie to work!

<div className="game-container">
<div className="navigation-container">
<div className="actions-container">
{actions.map((singleAction) => (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job with this page - you got the game to start after entering a username!

dispatch(actionsGame(direction))
}

const onRestartBtnClick = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job with the restart button!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants