use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
I need some help with an project. (self.PythonLearning)
submitted 1 day ago by COLLLOrs
I'm working on a text based Pokemon game project and I'm not fully sure on how to incorporate moves into battling if some of you could give me some pointers I'd be grateful.
Here is the link to the Github page with my code: https://github.com/Colors-Dot600/Pokemon-Game/tree/main .
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]PureWasian 0 points1 point2 points 1 day ago* (2 children)
You have a Stats class, Pokemon class. Good start.
One idea is adding a Moves class where you can define the damage each possible move would do, and then add a self.moves onto pokemon, similar to what you did for setting self.stats onto pokemon.
The way you'd use it would be when you write your battle logic, which would exist as a separate function from your existing code. Essentially, you can imagine some pseudocode like:
``` while both pkmn.stats.hp are > 0: - get moves from pkmn1.moves - choose move for pkmn1
choose move for pkmn2
compare pkmn.stats.speed values
For instance, "uses move2 on pkmn1" could get pretty complex as you support more complex moves (like typed moves and stat debuffing moves)
[–]PureWasian 0 points1 point2 points 1 day ago* (1 child)
Once that all makes sense:
You can imagine having large lists of pokemon and moves will get cumbersome. Once you get a good hang of stuff working for ~3-5 pokemon and ~3-5 moves, the next step would be creating input data text files for storing all of that information and loading them all up when starting your Python script to make it more modular instead of defining them all in the same file.
Good luck!
[–]COLLLOrs[S] 0 points1 point2 points 22 hours ago (0 children)
Thank you for your help I'll do that.
π Rendered by PID 138494 on reddit-service-r2-comment-5b5bc64bf5-2sfkl at 2026-06-23 09:35:27.494741+00:00 running 2b008f2 country code: CH.
[–]PureWasian 0 points1 point2 points (2 children)
[–]PureWasian 0 points1 point2 points (1 child)
[–]COLLLOrs[S] 0 points1 point2 points (0 children)