WildCodeSchool-2024-02 / JS-RemoteFR-CrewDragon-P2-Team2

Projet 2 - WCS
https://wizards-coders.netlify.app/
MIT License
2 stars 5 forks source link

US42-S3-Créer le useState Game. #67

Open VncPsq opened 4 months ago

VncPsq commented 4 months ago

`Step 2 : Afficher les personnages dans le combat

UseStates : Game --> string --> notStarted /finished / aborder / inProgress --> initial : noStarted Round --> int --> 1, 2, 3 : init 0

import { useState } from 'react' const games = { status: 'noStarted', currentRound: 0, player: { name : "Harry Potter", img : "https", health : 100, remainingSpells : { protego : true, confringo : true, stupeflix : true, slugulusEructo : true, }, }, computer: { name : "Draco Malfoy", img : "https", health : 100, remainingSpells : { protego : true, confringo : true, stupeflix : true, slugulusEructo : true, }, }, };

UseEffects : Chaque changement de currentRound Chaque changement de game `