Closed Arxcis closed 8 years ago
Have to reopen this issue. User name isn't being registered when same user restarts a new game.
Ill look into it
Reopened #8 https://github.com/EmilZach/Sentence-Crusher/issues/8.
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/EmilZach/Sentence-Crusher/issues/8#event-604582916
The reason is here -->> https://github.com/EmilZach/Sentence-Crusher/blob/master/Game/main.py#L29-L35
User name is stored before the While-loop. After each while -loop all data gets reset. Even the name is deleted from DataGuy()
Ill look into it
- mar. 2016 8.57 p.m. skrev "raglew" notifications@github.com:
Reopened #8 https://github.com/EmilZach/Sentence-Crusher/issues/8.
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/EmilZach/Sentence-Crusher/issues/8#event-604582916
*from data-object
The reason is here -->> https://github.com/EmilZach/Sentence-Crusher/blob/master/Game/main.py#L29-L35
User name is stored before the While-loop. After each while -loop all data gets reset. Even the name is deleted from DataGuy()
- mar. 2016 9.13 p.m. skrev "JoJo" jonas.solsvik@gmail.com:
Ill look into it
- mar. 2016 8.57 p.m. skrev "raglew" notifications@github.com:
Reopened #8 https://github.com/EmilZach/Sentence-Crusher/issues/8.
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/EmilZach/Sentence-Crusher/issues/8#event-604582916
After each while-loop we have to reset all data except player name.
How do you get that link to main.py with the particluar section marked out? That's cool.
What about: if continue_game == Y then store D.user in a variable: do the game data reset, and then set D.user = variable.
Yes thats a solution. But another solution is go into DataGuy() -class, and maybe make a reset-method. Which only resets the data we want to reset, leaving the rest of the data untouched.
What about: if continue_game == Y then store D.user in a variable: do the game data reset, and then set D.user = variable.
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/EmilZach/Sentence-Crusher/issues/8#issuecomment-202136878
That would be an even better solution: instead of D.init() in line 64 of main.py, call a reset method that is basically the same as def init(self) in the DataGuy class, but modified not to change D.user.
Yes , excactly. We reset-method can hold data that changes every new-game. And the init-method can hold data that sticks around.
That would be an even better solution: instead of D.init() in line 64 of main.py, call a reset method that is basically the same as def init(self) in the DataGuy class, but modified not to change D.user.
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/EmilZach/Sentence-Crusher/issues/8#issuecomment-202139880
Who wants to implement?
Doesn't matter for me. I can fix the issue if people wants to
Thanks Emil :)
No problem :-)
Is this what you wanted? Let me know if I should change anything.
Its works perfect. I changed it a bit more though, since you don't have to define all those variables TWICE in DataGuy(). Once is more than enough ;)
This issue is not relevant anymore after switch to object-oriented data handling.