Learn Python Classes With a Text-Based Battle - OOP Tutorial

  Рет қаралды 129,359

Ork Slayer Gamedev

Ork Slayer Gamedev

Күн бұрын

I'll guide you through object-oriented programming in Python, featuring classes, objects, attributes, methods, inheritance and subclasses - all in a fun way of creating a text-based ASCII battle scene!
Find the code I made for the video here 👇👇👇
github.com/orkslayergamedev/p...
×oOo×-----------------------👽SOCIALS👽-----------------------×oOo×
☕ SUPPORT ME: ko-fi.com/orkslayergamedev/ (be the first one ever, lol)
👾 PM FOR COMMISSIONS: www.fiverr.com/astral_freak/ (out of office)
🎮 TRY OUT MY GAMES: orkslayergamedev.itch.io/ (100% free)
Instagram: / orkslayergamedev
GitHub: github.com/orkslayergamedev/
Reddit: / orkslayergamedev
×oOo×--------------------🎞TIMESTAMPS🎞---------------------×oOo×
00:00 - Classes Basics
01:39 - Character Class
05:20 - Weapon Class
06:53 - Class Inheritance: Hero & Enemy
10:24 - HealthBar Class
14:57 - Final Result
×oOo×--------------------------✨TAGS✨--------------------------×oOo×
#python #tutorial #classes #ascii #gamedev
#objectorientedprogramming #oop
#indiedev #indiegame #indiegames
#indiegamedev #pixelart #gamedevelopment
#orkslayer #orkslayergamedev
#videogame #game

Пікірлер: 252
@DenisTrebushnikov
@DenisTrebushnikov 10 ай бұрын
utf-8: chr(9608) = ord("█") - for those who can't get it by typing "alt+0219" ASCII because in utf-8 hex it's 'e2 96 88' (©- by typing "alt+0169" is works fine). This issue may happens with using local languages keyboard. once again: self.color = self.colors.get(color, self.colors.get("default")) - dict.get() takes the default value by the 2nd argument if missed the key. and to get full right OOP experience, wrap all main code to some function: def run(): name = input("Enter the name: ") hero = Hero(name=name, health=100) hero.equip(iron_sword) enemy = Enemy(name="Enemy", health=100, weapon=short_bow) while True: hero.attack(enemy) enemy.attack(hero) hero.health_bar.draw() enemy.health_bar.draw() if not input("Press Enter to quit: "): break if __name__ == '__main__': run() \m/. .\m/ structure if __name__ == '__main__' is equal: to C/C++: int main( void ) { // some code return 0; }; to Java: public class Main { public static void main (String[] args) { // some code}; } to C#: class TestClass { static void Main(string[] args) { // some code } }
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Hey there, thanks for the useful additions again! Let me share my thoughts: 👉🏻 The best way to use the .get method of dictionaries is the one you just mentioned - seems like I slipped over this simplification when making the video. 👉🏻 Wrapping the game in a run function is a nice way to handle it. I usually create a Game class for this and call it from the main.py that serves as the entry point of the project. And with this, you won another pin 🤙🏻
@user-vc7bs8dp2jdhj
@user-vc7bs8dp2jdhj 11 ай бұрын
criminally underrated video
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
Thank you, it really means a lot to me! 🙏🏻
@sayanbiswas7796
@sayanbiswas7796 5 ай бұрын
You are goddam right KZfaq algorithmic really gone potato mode with this one video quality is godly
@obedience7641
@obedience7641 5 ай бұрын
You are 100% correct. It’s nice to see a developer showing love to another developer instead of looking for faults and being so petty. There’s never just 1 way to do a thing. ABSOLUTELY underrated!!!
@kenjii9626
@kenjii9626 3 ай бұрын
holy sht, best OOP tutorial . Glad youtube recommended you 😁
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
And I'm glad that you're here! Thanks a lot for the kind words, I appreciate it! 😊
@fieryelf
@fieryelf 3 ай бұрын
I've been learning Python for the past month and this is easily the best tutorial for Classes I've seen so far.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thank you for sharing your thoughts, I really appreciate it! I'm so glad that many people are enjoying my tutorial 🙏🏻
@danielhegyi5037
@danielhegyi5037 4 ай бұрын
Your video is the perfect proof that when you're looking for a good tutorial video you shouldn't always care about the views on it, because there's might be a hidden gem like this. Thanks for the upload!
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Thanks a bunch for the kind comment, I really appreciate it! I'm still grateful for my handful of views and will continue to upload cool content for my audience 🙏🏻 Cheers from Hungary! 👋🏻
@lucaslima7759
@lucaslima7759 18 күн бұрын
If you don't learn about classes with this video, just forget about it 😂. Cleanest video about classes that I ever watched
@bow_wow_wow
@bow_wow_wow 5 ай бұрын
Ah! You know so many Python features. It disturbs me a little bit when some big time KZfaqrs seem unaware of these things. Thank you!
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Thank you for the kind words, it sure feels great to have a wider knowledge in Python! I try to represent as many of the little tricks as I can 🙏🏻
@weshen83
@weshen83 4 ай бұрын
I have watched a lot of beginner programming tutorials, and haven't been busy with it for two years. And then this video gets recommended that teaches me concepts that just wouldn't "click". Thank you so much for creating this video, and keep it going. You deserve a lot more views and subscribers, just keep going and you probably get notices by the algorithm.
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Thanks so much for the great feedback, I really appreciate it 🙏🏻 I'm really happy that my video helped you with your programming journey! Feel free to drop any question in the future if you need help 👋🏻
@Blackronin357
@Blackronin357 11 күн бұрын
I learned alot from this video about classes and being able to put it together in visual manner really helps students like us grasp it better.
@deadspace2595
@deadspace2595 2 ай бұрын
I think this is about as simple explanation as one can get for this. I still don't understand the classes fully, but this video definitely helped a lot. I just wish you were talking slower and explaining things more as you do them cuz ngl I got lost A LOT watching this.
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
I learned it the hard way unfortunately so I wanted to share my knowledge the most fun way possible! Thanks for the feedback and sorry if the pace was too fast, it's hard to find the right one most of the time 😓 Let me know if you have Python related questions along your learning journey! 🐍
@sh_4016
@sh_4016 10 ай бұрын
Finally i understand classes in python after 3 years thanks Also I love the new style of your video, this time it actually fits perfect
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Wow, I'm really happy to hear this! I struggled with classes for a long time and I wanted to make a video with clear explanation. Thanks a lot for the feedback, I'm glad you like the editing too :)
@ambrishdubey2241
@ambrishdubey2241 4 күн бұрын
Hello orky, this video is awesome. Would like if you create these type of vdos on other topics of python like variables, decorators, loops and many more and a bonus project based on them. This would definitely help your channel reach a bigger audience as well. Hope you read this and think about it. Thanks man!
@corveux5143
@corveux5143 10 ай бұрын
Absolutely best explanation of OOP for Python I have come accross (maybe its just because I understand it better in gaming terms), thank you so much for this!
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Hey, thanks a lot for the feedback, I really appreciate it! 🙏🏻 I wanted to create such a tutorial that if I watched it years ago, I understood classes much faster 😁 Based on the comments, I achieved this goal, so I'm really happy!
@zd4w9
@zd4w9 2 ай бұрын
This video really helped me understand to the point where I could go back and find my mistakes on my own. Thanks a lot!!
@orkslayergamedev
@orkslayergamedev Ай бұрын
I'm glad my video was helpful to you! Good luck with coding! 🐍
@djciregethigher
@djciregethigher Ай бұрын
Wow!! Thank you. That was a quick, concise, and extremely educational demonstration of OOP! Cheers!!
@orkslayergamedev
@orkslayergamedev Ай бұрын
I'm glad you found it educational and helpful - part 2 coming soon! Until then, happy coding! 🙌🐍
@thomaskottke6112
@thomaskottke6112 Ай бұрын
Nice video, I appreciate you example was more realistic than a lot of other class tutorials I have seen.
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thank you! I’m happy to hear you found the video useful! 🙌 Stay tuned for more! 🐍
@igibomba
@igibomba 3 ай бұрын
Just started with OOP and this video bangs 🤘. Quality upload, will subscribe for more.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
I appreciate your support, thank you so much! 🙏🏻
@nike-1683
@nike-1683 11 ай бұрын
Hooray! Thank you very much for the new video!
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
And thanks a lot to you for the feedback! I'm happy you enjoyed the content 😊
@shi7196
@shi7196 2 ай бұрын
Making a complicated subject easy to understand and fun while at it is incredible.
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
I'm glad you had fun with the video, happy coding to you! 🐍
@bernardogeocometto5562
@bernardogeocometto5562 3 ай бұрын
Super useful, just started programming, and OOP is amazing because it makes everything more flexible. The video and the examples are awesome also. It gave me ideia to make of on my own, like a spaceship project.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thanks a lot for the amazing feedback, I really appreciate it! That spaceship project you mentioned sounds epic, feel free to share it with me anytime if you make it public! 🚀
@joekhames4161
@joekhames4161 Ай бұрын
Woooow I am 5 min in and it's amazing how it makes sense and easy it's to understand, keep up the good work ❤
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thank you so much! ❤ I'm happy to hear it's helping you out. Keep your eyes open as there's more to come soon! 🙌🐍
@gamerchristian3679
@gamerchristian3679 Ай бұрын
Subscribed, finnaly understand classes, thanks mate!
@orkslayergamedev
@orkslayergamedev Ай бұрын
That's fantastic to hear! 🙌 Thanks for subscribing and happy coding! 🐍
@apkaless
@apkaless Ай бұрын
wow thats the video i were waiting for, thanks man
@orkslayergamedev
@orkslayergamedev Ай бұрын
So glad to hear that! I appreciate your feedback! 🙌
@evil_in_your_closet
@evil_in_your_closet 2 ай бұрын
Very cool! Its quick, concise and clear! Instant Subscribe!
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thanks for joining us, I appreciate it! Have fun coding! 🐍
@MineGamerIL
@MineGamerIL 10 ай бұрын
Your channel is an absolute bliss ! , So glad I stumbled upon you .. Cheers !
@orkslayergamedev
@orkslayergamedev 9 ай бұрын
Wow, you're so kind! Thanks for joining us, I'm glad to have you here 🙏🏻❤️
@PabloSanDev
@PabloSanDev Ай бұрын
Thank you for this great tutorial, i'm very happy with it.. this game logic, architecture is exactly what i wanted to learn i followed along by using C# to challenge myself amazing again tysm.
@orkslayergamedev
@orkslayergamedev Ай бұрын
Wow, that was surely a great challenge, good job! I appreciate your feedback and thanks for joining us! 🙌🏻
@mariuszowczarek1875
@mariuszowczarek1875 11 ай бұрын
Thank You. Great Example and easy to understand !👍
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
Thank you for the feedback, I greatly appreciate it! 🙌🏻
@YDV669
@YDV669 Ай бұрын
I just realized after watching this video that history truly cheated us by denying us the existence of a knight in full armour wielding an RPG.
@orkslayergamedev
@orkslayergamedev Ай бұрын
I definitely forgot about that part - thanks for the good laugh! 😂
@LBCreateSpace
@LBCreateSpace 15 күн бұрын
Great explanations
@bernardseno2535
@bernardseno2535 3 ай бұрын
This video deserves a million views and you Sir deserve a million subscribers. Thanks to your video I was able to understand Python's OOP and this is coming from a person who's third language is English. Your video presentation together with your explanation made this complex topic easy to understand. Subscribed.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Wow, such kind and encouraging words! Thank you so much for the support, it truly means a lot to me! I'm glad the video helped you on your programming journey and I hope to see you around the channel 🙏🏻
@t.t.cooperphd5389
@t.t.cooperphd5389 5 ай бұрын
what an awesome tutorial on OPP. well done.
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Thank you very much for the feedback, much appreciated! 🙏🏻
@bandedecodeurs
@bandedecodeurs 4 ай бұрын
Super cool video. Really loved it Well though and well realized. Please, continue ! 🙏🏻
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
I will for sure! Thank you very much for the feedback, I really appreciate it! 🙏🏻
@cesarjaramillo4057
@cesarjaramillo4057 10 ай бұрын
Excelent content, i hope this channel explode so i can see you guide to recreate dwarf fortress in the future 😊
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Thank you so much! 🙏🏻 Let's find that out in the future! With enough time and effort, everything is possible 😁
@bennyuchiha8501
@bennyuchiha8501 4 ай бұрын
Wow, I did now know how much I needed this
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
I'm glad you found it useful! Have fun with your new knowledge 🙌🏻
@lexelis9571
@lexelis9571 4 ай бұрын
I'm actually working on a text-based adventure game, and this is exactly what I need! :D Already got most of what you've shown, but it's much better written and you expand upon things I couldn't have done
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey! I'm glad you found the video helpful, I appreciate your feedback! Good luck with your game and feel free to drop any questions if you need help 😊
@lexelis9571
@lexelis9571 4 ай бұрын
@@orkslayergamedev Hi thank you! I might need some advice sometimes if I get stuck. How would be the most convenient way for reaching out?
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Well, I check the youtube comments daily and if there's a question, I respond asap (yet yt studio only shows new comments and not answers unfortunately) You can also contact me on Ko-fi via direct messages, there I can even send code snippets via screenshots if needed :) Lastly there's my instagram and social email adress, but I check those rarely. You can find all my contacts on my channel page 🙌🏻
@ddkrscovers4163
@ddkrscovers4163 28 күн бұрын
Köszi a segítséget! Mindig újra és újra belekezdtek a Python programozásba, de mindig megakadok amikor jön egy nehezebb feladat és a végén feladom. Remélhetőleg ezúttal sikerül megtartani a motivációt. Eddig nagyon tetszik a channel, remélem lesznek még videók. Könnyen érthető a magyar akcentussal. :DD Az elején fogalmam sem volt hogy magyar vagy, aztan a videó felénél klikkelt az agyam.
@orkslayergamedev
@orkslayergamedev 21 күн бұрын
Szívesen! 😊 Ne aggódj, gyakran futunk falakba, ami elég gyorsan alá tudja ásni a tanulás iránti elkötelezettségünket. 5 év tapasztalattal sincs ez máshogy - ilyenkor egy lépés hátra és meg kell próbálni vagy máshonnan megközelíteni a problémát, vagy esetleg kisebb lépésekben haladni. Őszintén örülök, hogy rám találtál és hogy tetszik a csatorna! Lassan, de biztosan érkeznek az új tartalmak :) Addig pedig keress bátran bármilyen kérdéssel, igyekszem figyelni a kommenteket minél gyakrabban. Sok sikert a Pythonhoz! 🙌🐍
@ColinTimmins
@ColinTimmins 4 ай бұрын
Thank you for this video as It’s really well done. I’m dyslexic, among other things, and been learning to code. Material like this is very appreciated. =]
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Thank you for your kind comment, it means a lot! Feel free to leave questions anytime! 🙌🏻 Hope to see you around and good luck with your coding experience! 😊
@Joaopedro-kp9mu
@Joaopedro-kp9mu 5 ай бұрын
this video is so underrated for what it delivers.
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
I really appreciate your words, thank you so much! 🙏🏻
@sirknumbskull3418
@sirknumbskull3418 5 ай бұрын
You nailed it! I am interested in the Code Patterns. It is hard to find a tutorial, that shows you how to construct that whole thing WITH PURPOSE! Most tutorials just type a code and you habv no Idea about the WHY that and NOT that? So you filled a gap here! Thanks!
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey there, thanks a bunch for your awesome feedback! I always try to deliver meaningful content with context, answering all possible questions in-the-go. So I'm really happy that you discovered this video and that it lived up to your expectations! I love design patterns too, it's fun to construct the code in different ways to reach the best efficiency. Happy coding! 🚀💻
@kevinmaas7867
@kevinmaas7867 4 ай бұрын
its really cool video i will bookmark this for learn again in future
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thanks a lot, hope to see you around the channel soon! 🙏🏻
@circuithijacker
@circuithijacker 4 ай бұрын
Amazing tutorial!
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Thank you very much, I appreciate it! 🙏🏻
@kirthi1942
@kirthi1942 3 ай бұрын
This tutorial was so useful :D !
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
I'm glad you like it, thanks for the feedback! :)
@none3242
@none3242 3 ай бұрын
Okay ! this video is much better that others which has million of views , such a gem you are edit: and you got a sub ~~
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
I really appreciate your kind words, thank you so much! 🙏🏻 Welcome aboard! 🐍
@andrewfrost8866
@andrewfrost8866 6 ай бұрын
Excellent and informative!!
@orkslayergamedev
@orkslayergamedev 6 ай бұрын
Thank you very much! 🙏🏻
@tjb3171
@tjb3171 Ай бұрын
awesome, thanks!!
@orkslayergamedev
@orkslayergamedev Ай бұрын
Glad you enjoyed it! 🙌
@williamworchibobeagomez9220
@williamworchibobeagomez9220 5 ай бұрын
EXCELENT TUTORIAL I DIDNT KNOW THAT I COULD CHANGE THE COLOR OF MY TEXT LIKE THAT!
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Thank you very much for the feedback! Coloring console text adds so much to any project/game, have fun using it 🙌🏻
@Lion8585
@Lion8585 2 ай бұрын
Excellent video, thanks for sharing
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
Thanks for the feedback! 🙏🏻
@aleksanderyevdokimov2640
@aleksanderyevdokimov2640 2 ай бұрын
Cool project. Thanks for video.
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thank you, I appreciate your feedback!
@pionayd277
@pionayd277 20 күн бұрын
Better than my CS teacher
@orkslayergamedev
@orkslayergamedev 18 күн бұрын
Thanks so much for the kind words! 🙏‍
@alanharyaki4890
@alanharyaki4890 3 ай бұрын
The best python tutorial video I've ever watched. Hope I had watched it earlier.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thank you very much for the kind comment, I appreciate it!
@boredgamesph4872
@boredgamesph4872 3 ай бұрын
Looking forward for the next chapter for this like adding RNG (Critical, dodge, block). Thanks for this kind of lesson.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thank you, much appreciated! I hope to create more content like this as it's huge help to lots of people. If you have any suggestions or requests regarding topics you would like to see on the channel, feel free to share them with me anytime!
@boredgamesph4872
@boredgamesph4872 3 ай бұрын
@@orkslayergamedev Please create tutorial on how to make game with RNG with programming.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Alright! I'll add it to the topic poll and see if people like the idea!
@switbitz
@switbitz Ай бұрын
I love how you implemented game development in a python oop tutorial.
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thanks a lot! My aim is to make coding fun! 🐍
@kaushalshailbinha7365
@kaushalshailbinha7365 3 ай бұрын
best explanation of class
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thank you, I appreciate it! 🙏🏻
@adenozin
@adenozin 3 ай бұрын
great video, thanks !
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thanks a lot for the feedback, I'm glad you enjoyed it!
@codecaine
@codecaine 2 ай бұрын
Well done
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thank you! 🙌🏻
@knut-olaihelgesen3608
@knut-olaihelgesen3608 10 ай бұрын
The naming convention for class names is called Pascal case. It takes the form of MyCoolClass, while Camal case takes the form myCoolClass (lower case starting letter). Use Pascal case!
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
I know that PascalCase exists, although there's some misconception on the web about camelcase actually being camelCase or CamelCase. We even had a debate with my co-workers. Although camelCase would make more sense, so you're most probably right!
@wilsonliu1716
@wilsonliu1716 27 күн бұрын
love it! btw what's theme is this? I like the way of highlighting style
@orkslayergamedev
@orkslayergamedev 21 күн бұрын
Thank you! 🙌 I recently switched from this one but I believe it was the One Dark Italic style from the One Dark Theme plugin. Here's the link: plugins.jetbrains.com/plugin/11938-one-dark-theme
@jogalysyndrone1316
@jogalysyndrone1316 11 ай бұрын
very cool!
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
Thank you very much! 🙏🏻
@NuWerra_OF
@NuWerra_OF 2 ай бұрын
as a beginner this was a pain in the ass but i learned a lot and honestly this is amazing because i don't think i've could do this if it wasn't for making a game
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
I struggled with classes long ago as well, I know the feeling! Back when I started using Python I created really simple ASCII games, it's a pretty good way of learning in my opinion :)
@ridabrahim7604
@ridabrahim7604 5 ай бұрын
thanks for the explanation, just wish if it was a little bit slower, but still great way to understand oop more deeper
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Thanks a lot for the feedback, I appreciate it! I'm sorry if it turned out to be a little too fast, I always try to set a pace that the tutorial is comprehensible yet fast enough that nobody falls asleep by the end :)
@ZeroSpawn
@ZeroSpawn 4 ай бұрын
Just watch at 0.5 speed. His voice will change a bit. 😅
@djalmatech
@djalmatech 2 ай бұрын
Its very nice seen all what I learned as a borring way in a fun way, also, I notice the mistakes right away, buts its fine, nice video my boy 1+sub
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
I'm glad you enjoyed the video even with experience in oop! Thanks for joining! 🙏🏻
@Charlie-nx9pk
@Charlie-nx9pk 3 ай бұрын
Hi there! I just started learning python and using Pycharm IDE. I'm just following the steps as you said but the intellisense is not working when i try to import the Character. Could you please help me with that?
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Hey, of course, I'd be happy to help you! PyCharm can be a bit complicated if you just started out whit programming, I also had issues with it when I learned the basics. I'd try the following steps to fix the issue: First of all, give the computer a restart if you haven't done it already. If the problem persists, try to use: from .character import Character instead of from character import Character This way you explicitly import Character from the character module that is in the same directory as the file you call the import from. If the problem persists, it's likely due to improperly configured interpreter and root path. You can fix this by going to File > Settings > Project: [Your Project Name] > Python Interpreter, and selecting the correct interpreter if it's not already selected. Then to configure the root path you can right-click on the project root directory in the Project tool window, select "Mark Directory as," and then choose "Sources Root." Let me know if these steps solved the problem!
@theosouza165
@theosouza165 Ай бұрын
can you explain the: else ' ' :part of the code in the draw method for health bar. self.color if self.is_colored else '' im confused on exactly what this bit of code is doing
@orkslayergamedev
@orkslayergamedev Ай бұрын
Hey! I apologize for the late reply, hope you figured out by now. If not, don't worry, let me explain. The expression you mentioned decides if the text after that row (the bars of the health bar) should be colored or not. If the self.is_colored is True, then the color code will be applied, coloring the health bar. Otherwise, if the self.is_colored is False, we'll leave an empty string there that does nothing. This way the bar won't be colored. Let me know if it's clear for you now! 🐍
@GamingGuruImMortaL
@GamingGuruImMortaL 11 ай бұрын
Easy to understand explanation👍🏻
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
Thanks a lot, bro! I was aiming to make it as beginner-friendly as possible 😁
@GamingGuruImMortaL
@GamingGuruImMortaL 11 ай бұрын
@@orkslayergamedev will you be doing a mini game tutorial with pygame-ce?
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
Couldn't say no to a top sub 😎 I think the space shooter tutorial (that comes after I documented my latest game) would go well with the imporved performance of pygame-ce, especially for the transparent displaying and scaling. But if you have any suggestions, I'm open for ideas 👌🏻
@GamingGuruImMortaL
@GamingGuruImMortaL 11 ай бұрын
@@orkslayergamedev that sounds great, I was like thinking of a complete game starting from a home page (with settings and start button) then the game and the end screen. Showcasing the transition that takes place between these scenes. There are many tutorials online on how to code game mechanics but there are almost none teaching how to make a complete game.
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
That's actually a great idea! It won't increase the overall complexity of my tutorial too much, so why not. Let the needs of my people be satisfied 🙌🏻 First some space shooter devlogs, than this complete space shooter game tutorial 👌🏻
@nobody5674
@nobody5674 10 күн бұрын
What did you do at 5:58?
@peaceanquiet4528
@peaceanquiet4528 3 ай бұрын
Question for hp dmg. Why use the max function to prevent it from going below zero, I'm new and my first thought would be a min.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Thanks for the question! It's totally up to your game logic how you want to handle health, although I like to set all negative values to zero. This way whenever I want to display health bars, I don't need to worry about incorrect negative numbers. If min is confusing to you, take a look at the following: max(health, 0) means the same as if health < 0: health = 0 Let me know if I can help with anything else!
@shalevforfor5550
@shalevforfor5550 5 ай бұрын
OK good to know thx and after it you need to add it visually if you code in pygame ehat make the code longer
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Sure thing! I worked a lot with health bars using Pygame. Including cool visual effects like bubbles in the bar, dynamic decrease/increase instead of instant, so on. I think I even gave some insights in the #8 devlog of Ork Slayer
@HrafnNordhri
@HrafnNordhri 3 ай бұрын
First, thanks for this. Second, Which editor is this? I've been using an unregistered copy of Sublime. When I run the code shown at 5:18, I only get one set of values, you seem to get multiples. I tried running it several times in a row and only get the same variables no decrease in their health.
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Hey there! I use PyCharm Community Edition but the code should run as expected regardless of the editor you use. The terminal expects an input in each cycle, did you press enter in the console?
@HrafnNordhri
@HrafnNordhri 3 ай бұрын
@@orkslayergamedev I did and no go.. So I installed pyCharm and worked great. Thanks!
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
I'm glad that it worked at the end! Have fun using PyCharm, it has lots of cool features that you'll like! 🐍
@cleomenezesjr
@cleomenezesjr Ай бұрын
Just understood it now
@orkslayergamedev
@orkslayergamedev Ай бұрын
Awesome! Keep up the learning! 🐍
@stephenmackenzie9016
@stephenmackenzie9016 2 күн бұрын
Hero dropped his fists…
@tatsu4082
@tatsu4082 4 ай бұрын
Damn, your video is so nice and you help me a lot!! Sad youtube recommend late😢
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
I'm really happy that you find my content helpful, thanks so much for the feedback! 🙏🏻
@shauryagupta3644
@shauryagupta3644 3 ай бұрын
Bro what an insanely helpful tutorial tysmmmm I had a doubt: When defining the methods, what does the "-> None" do at the end?
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
I'm glad you enjoyed the video! 🙏🏻 When defining functions and methods, you can leave type hints for the arguments and the return value. Let me show examples: def sum_numbers(n1: int, n2: int) -> int: return n1 + n2 Here we say both arguments should be integers, just like the returned number. If you use an IDE (code editor) that has a built-in linter (code checker), it will automatically warn you if you A, define the function/method in a way that the actual returned value is not what you define in the first line (where the arrow points): def sum_numbers(n1: int, n2: int) -> int: return str(n1 + n2) B, you call the function/method with arguments not matching their annotated types: sum_numbers(n1="string", n2=True) So, whenever you create a method that returns nothing, you can also emphasize it by putting -> None at the end of the definition, like... def useless_printer() -> None: print("I don't return anything") ...and when you call it: result = useless_printer() >>> "I don't return anything" print(result) >>> None Whereas you call the other method that has a returned value... result = sum_numbers(3, 4) print(result) >>> 7 I hope it's clear now, let me know if I can help with anything else!
@shauryagupta3644
@shauryagupta3644 3 ай бұрын
@@orkslayergamedev Ohh gotcha, thanks a lot for such a fast and comprehensive reply!
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
No problem, glad to be of service!
@tinypopura
@tinypopura 4 ай бұрын
I'm still in the beginner phase of learning python, but this was very helpful! Classes and definitions are the bane of my existence, but I understand them a little more now thanks to you. Since the game doesn't end after the health bar reaches "0", what would be a good way to implement that into the code? I've added: if self.current_value==0: exit() Which seems to do the trick, but is there another way to do this?
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Thanks a lot for the feedback, I'm glad my video helped you with programming! 🙌🏻 Let me assist you with quitting the game! Here's the original main loop of this video: # ------------------------------------------- while True: os.system("cls") hero.attack(enemy) enemy.attack(hero) hero.health_bar.draw() enemy.health_bar.draw() input() # ------------------------------------------- One way of handling the quit event is to break out of the while loop whenever the health of the hero reaches 0: # ------------------------------------------- if hero.health 0 # ------------------------------------------- We can even wrap all this into a Game class to make it nicer: # ------------ game class ------------ class Game: def __init__(self): self.running = True def run(self) -> None: while self.running: os.system("cls") hero.attack(enemy) enemy.attack(hero) hero.health_bar.draw() enemy.health_bar.draw() input() self.running = hero.health > 0 input("GAME OVER") exit() # ------------ game loop ------------ if __name__ == "__main__": game = Game() game.run() # ------------------------------------------- Feel free to copy-paste this into your main.py :) Drop your questions whenever you need more help!
@oliveselow-bw3py
@oliveselow-bw3py 5 ай бұрын
Like it..!
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Thank you! 🙏🏻
@philtoa334
@philtoa334 11 ай бұрын
Nice.
@orkslayergamedev
@orkslayergamedev 11 ай бұрын
Thanks a lot! 👋🏻
@8-bite393
@8-bite393 5 ай бұрын
It is very nice to see the progress in the video, but without my own thoughts it is very confusing to follow along :)
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Thanks for the feedback! Don't worry, when I started learning classes years ago, it was very confusing for me too. It's not a simple concept to comprehend especially if you just started learning programming. Although the more and more you use classes, the easier the whole language is gonna be. So keep practicing and one day it will be easy as 1+1 :)
@maxmuster7003
@maxmuster7003 10 ай бұрын
It looks nice. I am not familar with high level programming. I use only x86 assembly low level and i can use free memory to build tables for character and weapon.😅
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Hey, thanks! Sounds cool to me 😁 Wish I had the time to learn about low-level programming. One of my friends once recreated Celeste for a microcontroller, it's crazy!
@muammerbeytekin6446
@muammerbeytekin6446 5 ай бұрын
Thanks a lot! but i didn't get how to do 10:21, which kind a if statement i need?
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Hey there! As you can see in the console output, the hero can drop it's default weapon too (Fists) - which is probably a bug we don't want in our games. The simplest way to resolve this issue is to update the drop method as follows: def drop(self) -> None: if self.weapon != self.default_weapon: print(f"{self.name} dropped the {self.weapon.name}!") self.weapon = self.default_weapon
@muammerbeytekin6446
@muammerbeytekin6446 5 ай бұрын
Thanks man u are really my favorite Python teacher rn! @@orkslayergamedev
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
I really appreciate your kind words, thank you so much! I hope that you'll enjoy the upcoming content as well 🙏🏻 (ps. sorry for the late reply, youtube sends no notifications of comment answers)
@x4tra557
@x4tra557 29 күн бұрын
Hey, I know it's quite an old video but I have a question. It would be really helpful if you would be able to answer! So, Why did you put 'self' everywhere? What does it do? (I know it's a rookie question but I'm just getting into this stuff)
@orkslayergamedev
@orkslayergamedev 21 күн бұрын
Hey there! No worries at all; there are no rookie questions here. I'm happy to help! The keyword self is used in Python class methods to refer to the instance of the object it"self". Whenever you define a method inside a class, you need to include self as the first parameter so you can access the instance's attributes and other methods. When you use self, you're telling Python which object's data to access or modify (again, the data of the object itself). Furthermore, you could name it anything else, self is just a naming convention. This would work as well... class Hero: def __init__(the_object_itself, name): the_object_itself.name = name But when you actually create an object, you don't need to pass that self-referencing argument... hero = Hero("John") When you want to access the name of the hero object like... hero.name ...what Python does is it looks into the object and searches for self.name (or the_object_itself.name in this case). Hope this helps a bit! Let me know if you have further questions, I'll keep an eye out for your comment! 🐍
@x4tra557
@x4tra557 21 күн бұрын
You made it so much clearer to understand. Thank you so much!
@emirhancalskan665
@emirhancalskan665 Ай бұрын
good video😎
@orkslayergamedev
@orkslayergamedev Ай бұрын
Thanks! Glad you liked it! 🙌
@micahmcconnaughey4732
@micahmcconnaughey4732 4 ай бұрын
You lost me with the target.hp. Where is hp defined?
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey 👋🏻 If you wait a couple of seconds in the video, I fix this error at 5:10. That "hp" should be "health". Since the target is an already initialized character, it will have its health attribute set in the initializer method. Sorry for the confusion!
@demonman1234
@demonman1234 2 ай бұрын
I like to think about it like a container of cookies or something.. You got a container which holds cookies Each cookie has their own values (shape, size, flavor, etc) You can inherit it by putting it into another container… and so on. Now this way of thinking about it falls short when it comes to polymorphism, at least in my example.. but oh well.
@orkslayergamedev
@orkslayergamedev 2 ай бұрын
Interesting concept! You can easily incorporate polymorphism in your idea if you define the classes this way: class Food(ABC): @abstractmethod def eat(self): pass class Cookie(Food): def eat(self): print("You ate a cookie.") class Container(ABC): @abstractmethod def store(self, food): pass class CookieJar(Container, list): def store(self, cookie): self.append(cookie) print("You put a cookie in the jar.")
@demonman1234
@demonman1234 2 ай бұрын
@@orkslayergamedev True, if you include the container itself into the concept and actions performed on it.
@zettwire
@zettwire 4 ай бұрын
hmm just a quick question... do you know the difference between PascalCase and camelCase ?
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Sure thing! Just two naming conventions with the difference of the first letter of the first word being capitalized or not. Although camelCase is not commonly used with Python. Funny thing is that people tend to mistake PascalCase with camelCase thinking it's CamelCase (like camels with two humps, lol), I do it sometimes too, unintentionally of course
@thelastexpress4270
@thelastexpress4270 4 ай бұрын
f"{self.colors['default'] if self.is_colored else ""}" > This crashes the program each time. After messing around with it a bit it seems the issue is the ['default'] area. It says it can't be a string. I've commented it out and the program will run just without correctly working healthbars. Is there another way to write this?
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey! I see the problem. If you use f strings with double quotes, all strings inside should be single quoted. Vica-versa. Otherwise your code will yield a SyntaxError. Try this one with 2 single quotes after else: f"{self.colors['default'] if self.is_colored else ''}" Swapping all singles and doubles works as well: f'{self.colors["default"] if self.is_colored else ""}'
@thelastexpress4270
@thelastexpress4270 4 ай бұрын
@@orkslayergamedev sadly even doing that doesn't seem to help. It just really hates that default portion for some reason and switching from single to double quotes doesn't seem to matter. I was able to get it work by using your original code but for the life of me I couldn't see where the error on my part was as I copied it line from line but there must have been a wrong character somewhere.
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Don't worry, all of us come across anomalies from time to time, where seemingly everything is 100% corrent, yet we still get an unexpected error. I'm glad you got the code running either way. Let me know if I can help with anything else!
@ixgames
@ixgames 19 күн бұрын
hi. what color sheme do you use?
@orkslayergamedev
@orkslayergamedev 18 күн бұрын
Hey! It's the One Dark Italic style from the One Dark Theme plugin. You can find it here: plugins.jetbrains.com/plugin/11938-one-dark-theme
@ixgames
@ixgames 18 күн бұрын
@@orkslayergamedev tks
@getcake8680
@getcake8680 4 ай бұрын
Hey, I'm very new to Python. I was trying to copy your code word for word. I'm halfway the video but when I try to test I get error. It seems that whenever I type "from weapon import iron_sword" it says "unresesolved reference 'weapon' "
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey there! We usually get this error when the module we want to import is not in the same directory. If you're sure that all the files are in the same place, you can also try to use "from .weapon import iron_sword" to explicitly say that the file you're looking for is within that local folder. Let me know if it worked!
@ninobrouwers1818
@ninobrouwers1818 3 ай бұрын
not the person who asked the question but I had the same problem. This helped! thanks
@secretnobody6460
@secretnobody6460 4 ай бұрын
Could you show us guided tutorials for making minigame projects for python? I am a student in uni and i wanna focus on python for data science. But i need to master it first, by making games i will be able to relate to it and understand it much better because i am a gamer too!!. And i can show these projects to employers!
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey there, welcome here! 👋🏻 I started with small games too and now I'm a hired software engineer, so I was in the same boots :) I'd be happy to help with minigame tutorials and I'm always open for suggestions! I planned a space shooter game tutorial - that was postponed from last year unfortunately - with similar design as my almost complete Field Trip. Feel free to take a look at some of my recent videos, I could make a fairly simplified version of that game for a tutorial. Hope you like the idea!
@secretnobody6460
@secretnobody6460 4 ай бұрын
@@orkslayergamedev yeah! Exactly!! I wanna follow some of your footsteps. I was thinking about you doing another video for the games that you uploaded. A separate video on the behind the scenes of how you made that game, what are your thought process, the codes that gave solution, functions that were used etc. I would love to watch those and in the end i will also be able to make my own version of your game! ❤️
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
I'll try to live up to your expectations and continue delivering quality content! 🤞🏻 What I can promise besides whole minigame / feature tutorials is insights from - the close-to-release - Field Trip (eg. I plan to show some reuseable code to implement lots of different powerups quickly); then restarting the development of Ork Slayer and documenting the whole process on the channel! We will get there soon, thanks for sticking with us 🙌🏻❤️
@misterdenko9164
@misterdenko9164 10 ай бұрын
👏👏👏👏👏👏👏👏
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Köszönöm a kellemes meglepetést, kolléga! 😁
@misterdenko9164
@misterdenko9164 10 ай бұрын
Szép, igényes munkák ezek a videók, hatalmas gratula🙈😁
@orkslayergamedev
@orkslayergamedev 9 ай бұрын
@@misterdenko9164 Köszönöm szépen, sokat jelent a visszajelzés! Örülök hogy követed a tartalmat 🙏🏻😁
@SolathPrime
@SolathPrime 4 ай бұрын
- [14:53] I would like if you use: `os.system("cls|clear")` This way if command: `cls` is not defined -like in my linux machine-, it'll fall back to: `clear`
@SolathPrime
@SolathPrime 4 ай бұрын
Also I subscribed from this video and had the bell on so I don't miss any coming uploads ;-)
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Hey there! Thanks for the nice addition, I didn't know you can pass "cls|clear" as arguement, cool! And of course I'm happy to welcome you to the channel! 🙌🏻
@SolathPrime
@SolathPrime 4 ай бұрын
@@orkslayergamedev one little correction I need to add use "cls||clear" instead of "cls|clear" as the first ors `cls` with `clear` while the other pipes `cls` to `clear`
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Right, thanks for the correction! I'll use this trick later on 👌🏻
@Balance080
@Balance080 Ай бұрын
Great vid Ork, very educational and informative, could you help with one error i got at the very end: self.health_bar = HealthBar(self, color="blue") TypeError: HealthBar() takes no arguments | any help would be appreciated, thanks.
@orkslayergamedev
@orkslayergamedev Ай бұрын
Hey there! Thanks again for the feedback, much appreciated! I replied to your other comment with the solution, please take a look and tell me if it helped! 🙌
@Balance080
@Balance080 Ай бұрын
@@orkslayergamedev Hi Thnaks for the reply, and sorry for commenting on the wrong vid, had both open and commented on that one by mistake. As for my Init(s), i double checked all of them, and all of them are __Init__ (double underscored) no exceptions. still get it. Here's the relevant code: CHARACTER CLASS class Hero(Character): def __init__(self, name: str, health: int) -> None: super().__init__(name=name, health=health) self.default_weapon = self.weapon self.health_bar = HealthBar(self, color="blue") HP CLASS def __init__(self, entity, length: int = 20, is_colored: bool = True, color: str = "") -> None: self.entity = entity self.length = length self.max_value = entity.health_max self.current_value = entity.health self.is_colored = is_colored self.color = self.colors.get(color) or self.colors["default"] I don't think any typos are causing this, if you have any idea i would appreciate it? Thanks for your time. EDIT: one very strange thing is that once hover over the color in "HealthBar(self, color="blue")" it says "(function) color: any", but the init in hp class says "(parameter) color: str". This is the only place this happens all other inits. are correctly taking paramaters and all calls are sending paramaters to the class constructor, is it possible there's some inbuilt color function that's colliding with my paramater
@orkslayergamedev
@orkslayergamedev Ай бұрын
No problem buddy, hope we can figure this out. This issue is strange indeed. I copied the snippet you sent me to a fresh file and added minimal extra code to make it exectuable. When I hover over to the color argument of HealthBar in Hero, I get the right and expected hints. Please copy the following to a new file and try to run it with python in the console. If all is correct, you should see no messages on the screen. Give it a try. class HealthBar: colors: dict = {"red": "\033[91m", "purple": "\33[95m", "blue": "\33[34m", "blue2": "\33[36m", "blue3": "\33[96m", "green": "\033[92m", "green2": "\033[32m", "brown": "\33[33m", "yellow": "\33[93m", "grey": "\33[37m", "default": "\033[0m" } def __init__(self, entity, length: int = 20, is_colored: bool = True, color: str = "") -> None: self.entity = entity self.length = length self.max_value = entity.health_max self.current_value = entity.health self.is_colored = is_colored self.color = self.colors.get(color) or self.colors["default"] class Character: health_bar: HealthBar def __init__(self, name: str, health: int, ) -> None: self.name = name self.health = health self.health_max = health self.weapon = "" class Hero(Character): def __init__(self, name: str, health: int) -> None: super().__init__(name=name, health=health) self.default_weapon = self.weapon self.health_bar = HealthBar(self, color="blue") if __name__ == "__main__": char = Hero(name="dummy", health=10) assert char.health_bar
@Balance080
@Balance080 Ай бұрын
@@orkslayergamedev Done, it does work and show no error messages, only needed to add 2 more underscores to the if _name_ (i assume the youtube commets are deleting some underscores) As for this ""self.health_bar = HealthBar(self, color="blue")" hovering over color=blue now correctly shows "(parameter) color: str" and not function
@8-bite393
@8-bite393 5 ай бұрын
Hey there it’s me again! Can you tell me, why there is the None-Value in the def‘s ? Without it, it also works fine. Thx 🙏
@orkslayergamedev
@orkslayergamedev 5 ай бұрын
Hi! I'd be happy to explain. Functions/methods have that functionality to return values to the user. The returned value can be anything. It can even be nothing, if we don't put the return statement into them. Take this for example: def sum_values(number_1, number_2): return number_1 + number_2 If you call this method, like: sum_values(5, 3) It will return the number 8 to you. Or you can create other kinds of methods that won't return anything like: def print_something(text): print(text) Another optional thing you can do with python is leavign type hints / annotations of parameters and returned values of functions/methods. The above functions with type hints: def sum_values(number_1: int, number_2: int) -> int: return number_1, number_2 def print_something(text: str) -> None: print(text) This way you're making it clear what to expect those values to be and your code editor can suggest you type-specific attributes/methods of that value. It's totally not necessary and your code will work just fine without them. Although I like to include them everywhere as it makes your code more clear, especially when you work on a bigger project. Hope this helps! :)
@ZeroSpawn
@ZeroSpawn 4 ай бұрын
​@@orkslayergamedevwooooo! Thank you. I have had that question for 14 years
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
@@ZeroSpawn My pleasure, I'm glad if it's clear for you now! Happy coding to you 🐍
@8-bite393
@8-bite393 6 ай бұрын
At the moment I don’t understand OOP at all. I learn every day and someday I will get there 😅
@orkslayergamedev
@orkslayergamedev 6 ай бұрын
Don't worry, it took me years of practice to fully understand the concept and learn object-oriented programming. It will get easier and clearer the more you code, so keep up the good work! :)
@AndrasBalintBoroczky
@AndrasBalintBoroczky 3 ай бұрын
How did you open the builtins.py file?
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Simply double-tap shift in PyCharm, then type builtins.py 🙌🏻 Alternatively, hold ctrl then click any class/method that redirects you to the file
@AndrasBalintBoroczky
@AndrasBalintBoroczky 3 ай бұрын
Thank you!
@kevinmaas7867
@kevinmaas7867 4 ай бұрын
can u make this video for javascript version please? if u already did it please give me the link
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
My expertise is limited to Python at the moment, unfortunately. Although if anytime in the future I'll deal with javascript, I'll make such a video, promise! 🙏🏻
@micha5781
@micha5781 Ай бұрын
Instant sub mode: ON
@orkslayergamedev
@orkslayergamedev Ай бұрын
Awesome, welcome to the channel! 🙌 Thanks for subscribing! 🐍
@shalevforfor5550
@shalevforfor5550 5 ай бұрын
I think the health bar take you too much I use for
@Mentox2
@Mentox2 10 ай бұрын
Can you make the repository for this available again? Thanks.
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Oh, my bad! I thought it was ready and set to public, thanks for letting me know. 👇🏻 You can access it from now on :) github.com/orkslayergamedev/python-classes-text-battle
@Mentox2
@Mentox2 10 ай бұрын
@@orkslayergamedev Thank you, great tutorial btw, forgot to say. :P
@orkslayergamedev
@orkslayergamedev 10 ай бұрын
Thank you very much, I appreciate it! 🙌🏻
@user-rz7zk4rp7l
@user-rz7zk4rp7l 3 ай бұрын
can you make it with c++?
@orkslayergamedev
@orkslayergamedev 3 ай бұрын
Right now only Python fits into the scope of the channel but in case I dwell into C++ anytime, I'll create such a tutorial! Thanks for the suggestion!
@Dragontbone
@Dragontbone 4 ай бұрын
For those who dont want to type out all of the colors because its a slight pain in the ass, here you go: colors: dict = {"red": "\033[91m", "purple": "\33[95m","blue": "\33[34m", "blue2": "\33[36m","blue3": "\33[96m", "green": "\033[92m","green2": "\033[32m", "yellow": "\33[93m","grey": "\33[37m", "default": "\033[0m", }
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
In case anybody wants to copy my code or just needs to double-check everything, I have the git repository linked in the description! But thanks for pointing this out 🙏🏻
@Dragontbone
@Dragontbone 4 ай бұрын
@@orkslayergamedevI figured you did it on purpose to have people type this themselves. I just didn’t want anyone to deal with typing the colors since they are a little clunky to type in and Visual Studio Code doesn’t auto complete. 😂
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Right! I'm guilty as well for copy-pasting the colors in the video, don't worry 😁 If you need auto-completion with VSCode, I recommend GitHub Copilot which is a damn useful addition! It's not free but it's almost like it reads your mind! I don't use it myself but it's popular amongst my colleagues :)
@Milkguy33
@Milkguy33 4 ай бұрын
"Hero dropped the fists" ....what?...
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Take a look at the video at 10:20 again, as I hint an optional coding challenge for the viewers to implement a safety feature that prevents the hero from dropping the default weapon. You can give it a try or just use this solution: def drop(self) -> None: if self.weapon != self.default_weapon: print(f"{self.name} dropped the {self.weapon.name}!") self.weapon = self.default_weapon
@Milkguy33
@Milkguy33 4 ай бұрын
@@orkslayergamedevYes, thanks you to the solution! Even tho i wasn't confused about it
@orkslayergamedev
@orkslayergamedev 4 ай бұрын
Glad to hear it, happy coding to you! 🐍
EASY Random Map Generation - Python ASCII Tutorial
8:36
Ork Slayer Gamedev
Рет қаралды 5 М.
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 233 М.
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 27 МЛН
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 2,4 МЛН
КАХА и Джин 2
00:36
К-Media
Рет қаралды 4 МЛН
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 25 МЛН
Python Classes Tutorial #1 | Objects as a Prelude to Classes
8:57
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
DevLogLogan
Рет қаралды 446 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,7 МЛН
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Coding With Russ
Рет қаралды 810 М.
How Do You Improve Turn Based Combat?
17:43
Design Doc
Рет қаралды 739 М.
Teaching myself C so I can build a particle simulation
11:52
Gradience
Рет қаралды 164 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1 МЛН
How To Use Dunder Methods In Python Tutorial (Magic Methods)
6:36
Ele Comeu a TERRA da Planta😱 #shorts
0:59
Lucan Pevidor
Рет қаралды 8 МЛН
Cute Barbie gadgets 🩷💛
1:00
TheSoul Music Family
Рет қаралды 73 МЛН