Ninedeadeyes / 7-Dungeons-Deep

Action rpg game written in Standard Library Python 3 using the Turtle Graphics module include modularize and single file version.
3 stars 2 forks source link

"lives" variable is unclear #2

Open SauceChord opened 3 years ago

SauceChord commented 3 years ago

https://github.com/Ninedeadeyes/7-Dungeons-Deep/blob/58d9f26f73fc859ff78fd671732c0c8d7cfb329a/game%20(mod%20version).py#L356

I had a hard time getting what "lives" was used for. Its sent to player as "bob" parameter

https://github.com/Ninedeadeyes/7-Dungeons-Deep/blob/58d9f26f73fc859ff78fd671732c0c8d7cfb329a/game%20(mod%20version).py#L529-L539

https://github.com/Ninedeadeyes/7-Dungeons-Deep/blob/58d9f26f73fc859ff78fd671732c0c8d7cfb329a/player.py#L20-L22

and then to missiles and fireball as "mom".

https://github.com/Ninedeadeyes/7-Dungeons-Deep/blob/58d9f26f73fc859ff78fd671732c0c8d7cfb329a/player.py#L43 https://github.com/Ninedeadeyes/7-Dungeons-Deep/blob/58d9f26f73fc859ff78fd671732c0c8d7cfb329a/proj.py#L38-L44

It seems to be set to "3" when the game is over and used for not playing sound effects

https://github.com/Ninedeadeyes/7-Dungeons-Deep/blob/58d9f26f73fc859ff78fd671732c0c8d7cfb329a/game.py#L2006-L2015

I am working on a branch to clean up some code and I am not really sure what this variable is intended to do. I could remove it but it would be annoying if you had plans on doing something else with it.

Instead of calling it lives, bob and mom, perhaps a less confusing name would be "ignore_audio" or "game_over" and make it a boolean?

SauceChord commented 3 years ago

Also instead of passing it around to functions consider having a game state instance that your objects reference.

Ninedeadeyes commented 3 years ago

Hi, I think its to deactivate 'action' once the game has ended or you'll able to keep pressing attack and the attack sound still appear whilst this will deactivate once attack once game ends.. Yeah will clean up some of the variable names, oh and thanks for modulating my enemy class.

Ninedeadeyes commented 3 years ago

I think you can definite make louds of improvements on the code.. I'm more of a hobbyist coder than it actually having to do with my day to day job so not learnt any 'best practice' rather learnt by looking at random codes on the internet as well as figuring stuff by myself so apologies for any poor code practice..,

SauceChord commented 3 years ago

All good, I believe we are all "learning" something new everyday :) I am new to github collaboration so I dont know if I am really doing things the right way. I just wanted to help improve the code, not to derate you.

Ninedeadeyes commented 3 years ago

I am humbled that anyone would want to look and improve my code, so don't worry about it, I always welcome constructive criticism :) , I have no idea what I am doing on github at all.., I know enough just to put some of my projects online so it might help other beginners. Once I find the time I will probably will go though my codes again and change the variables so they make a little more sense.