0
I'd like a bird's eye view of Python and how everything works together.
I'm 2 weeks in and have studied many hours to get to the point where I know about variables, conditions, loops, lists, functions, and a little about classes. My question is how do I create the frame work for my text based RPG game. Why do we need classes, do they serve the same purpose as functions? I'm learning about what all this stuff means, but very oblivious on how it all is supposed to work together, keyword together, as a whole. I don't know where to begin when it comes to starting a game. Assign values to a bunch of variables first? Make a bunch of functions? Make a bunch of classes? I have no idea. 🤔
2 Antworten
+ 1
Learn more about classes first, they are used in object oriented programming or OOP. This essentially means that everything in your game will be an object, for example, in a shooters game each bullet will be an object, each character, weapon and etc. These object will be created through the classes and these classes contain many functions which manipulate the internals of an object for example, if your character moves a function will be called to move up by 5 steps and this will update the object relevant data.
+ 1
Check this out. It's a bunch of code that's a text based rpg. I used mostly classes but you don't have to. This started off at a couple hundred lines and now its over a thousand! Just keep learning and evolving your program
https://code.sololearn.com/cjGIfr8I4Fu2/?ref=app
https://code.sololearn.com/cND65j7GpYyj/?ref=app