Skip to content

Project-Calvin#8

Open
Cnkh6069 wants to merge 5 commits intorocketacademy:mainfrom
Cnkh6069:main
Open

Project-Calvin#8
Cnkh6069 wants to merge 5 commits intorocketacademy:mainfrom
Cnkh6069:main

Conversation

@Cnkh6069
Copy link
Copy Markdown

@Cnkh6069 Cnkh6069 commented Nov 9, 2024

Work in progress, trying to get the images to sync and the additional features.

Comment thread README.md

The page will reload when you make changes.
You may also see any lint errors in the console.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NICE readme

Comment thread README.md
- add the ability to create, read, update, delete a score. Betting mechanism.
- implment admin mode for the deletion and manual updating of score. Change state/UI.
- 2 ways to do: have a main where menu where the student choose to be a player or admin. Have a button for admin login for hard coded login.
What we recommend to achieve the API request, is use jsonbin.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One more thing we can add is how to install and how to run the app!

Comment thread src/App.jsx
import Button from "react-bootstrap/Button";

function App() {
//generating a random pokemon name from the json file.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this comment is a bit redundant. It is not directly over the function that's being called. And the function name also tells me what is happening

Comment thread src/App.jsx
const [score, setScore] = useState(0);
const [hpLeft, setHpLeft] = useState(6);

//7. When the round ends, give the user an option to play again or restart the game.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is the first thing I read, but labeled with 7. - confusing! Also, then name handleRestart captures this information already

Comment thread src/App.jsx

//7. When the round ends, give the user an option to play again or restart the game.
const handleRestart = () => {
setCurrentPokemon(getRandomPokemon()); // Reset with new Pokemon
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
setCurrentPokemon(getRandomPokemon()); // Reset with new Pokemon
setCurrentPokemon(getRandomPokemon());

useEffect(() => {
const scramble = () => {
const letters = currPokemon.split("");
const shuffledLetters = letters.sort(() => 0.5 - Math.random());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is where I would want to see a comment, as the math here does not mean anything to me reading the code

@@ -0,0 +1,38 @@
import { useState } from "react";
import Button from "react-bootstrap/Button";
//When the user makes a guess, add that guess to the App component's guessedPokemon state.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

redundant comment

setCurrGuess(text);
};
return (
//input field for player to input guesses
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
//input field for player to input guesses

Comment thread src/pokedex.jsx
pokeType: "Normal/Flying",
pokeImage:
"https://www.pokemon.com/static-assets/content-assets/cms2/img/pokedex/detail/021.png",
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

very nice data structure

Comment thread src/utils.jsx

export const getRandomPokemon = () => {
const randomPokedex = pokedex[randomIndex].pokeName.toLowerCase();
//Lowercase words for simplicity
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
//Lowercase words for simplicity

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